Class QPossibleValueSource

java.lang.Object
com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValueSource
All Implemented Interfaces:
MetaDataProducerOutput, QMetaDataObject, TopLevelMetaDataInterface, Serializable

public class QPossibleValueSource extends Object implements TopLevelMetaDataInterface
Meta-data to represent a "Possible value" - e.g., a translation of a foreign key and/or a limited set of "possible values" for a field (e.g., from a foreign table or an enum).
See Also:
  • Constructor Details

    • QPossibleValueSource

      public QPossibleValueSource()
  • Method Details

    • newForTable

      public static QPossibleValueSource newForTable(String tableName)
      Create a new possible value source, for a table, with default settings. e.g., name invalid input: '&' table name from the tableName parameter; type=TABLE; and LABEL_ONLY format
    • newForEnum

      public static <I extends Serializable, T extends PossibleValueEnum<I>> QPossibleValueSource newForEnum(String name, T[] values)
      Create a new possible value source, for an enum, with default settings. e.g., type=ENUM; name from param values from the param; LABEL_ONLY format
    • getName

      public String getName()
      Specified by:
      getName in interface TopLevelMetaDataInterface
    • setName

      public void setName(String name)
    • withName

      public QPossibleValueSource withName(String name)
    • getLabel

      public String getLabel()
      Getter for label
    • setLabel

      public void setLabel(String label)
      Setter for label
    • withLabel

      public QPossibleValueSource withLabel(String label)
      Fluent setter for label
    • getType

      public QPossibleValueSourceType getType()
    • setType

      public void setType(QPossibleValueSourceType type)
    • withType

    • getValueFormat

      public String getValueFormat()
      Getter for valueFormat
    • setValueFormat

      public void setValueFormat(String valueFormat)
      Setter for valueFormat
    • withValueFormat

      public QPossibleValueSource withValueFormat(String valueFormat)
      Fluent setter for valueFormat
    • getValueFields

      public List<String> getValueFields()
      Getter for valueFields
    • setValueFields

      public void setValueFields(List<String> valueFields)
      Setter for valueFields
    • withValueFields

      public QPossibleValueSource withValueFields(List<String> valueFields)
      Fluent setter for valueFields
    • getValueFormatIfNotFound

      public String getValueFormatIfNotFound()
      Getter for valueFormatIfNotFound
    • setValueFormatIfNotFound

      public void setValueFormatIfNotFound(String valueFormatIfNotFound)
      Setter for valueFormatIfNotFound
    • withValueFormatIfNotFound

      public QPossibleValueSource withValueFormatIfNotFound(String valueFormatIfNotFound)
      Fluent setter for valueFormatIfNotFound
    • getValueFieldsIfNotFound

      public List<String> getValueFieldsIfNotFound()
      Getter for valueFieldsIfNotFound
    • setValueFieldsIfNotFound

      public void setValueFieldsIfNotFound(List<String> valueFieldsIfNotFound)
      Setter for valueFieldsIfNotFound
    • withValueFieldsIfNotFound

      public QPossibleValueSource withValueFieldsIfNotFound(List<String> valueFieldsIfNotFound)
      Fluent setter for valueFieldsIfNotFound
    • getTableName

      public String getTableName()
      Getter for tableName
    • setTableName

      public void setTableName(String tableName)
      Setter for tableName
    • withTableName

      public QPossibleValueSource withTableName(String tableName)
      Fluent setter for tableName
    • getSearchFields

      public List<String> getSearchFields()
      Getter for searchFields
    • setSearchFields

      public void setSearchFields(List<String> searchFields)
      Setter for searchFields
    • withSearchFields

      public QPossibleValueSource withSearchFields(List<String> searchFields)
      Fluent setter for searchFields
    • withSearchField

      public QPossibleValueSource withSearchField(String searchField)
      Fluent setter for searchFields
    • getOrderByFields

      public List<QFilterOrderBy> getOrderByFields()
      Getter for orderByFields
    • setOrderByFields

      public void setOrderByFields(List<QFilterOrderBy> orderByFields)
      Setter for orderByFields
    • withOrderByFields

      public QPossibleValueSource withOrderByFields(List<QFilterOrderBy> orderByFields)
      Fluent setter for orderByFields
    • withOrderByField

      public QPossibleValueSource withOrderByField(QFilterOrderBy orderByField)
      Fluent setter for orderByFields
    • withOrderByField

      public QPossibleValueSource withOrderByField(String fieldName)
      Fluent setter for orderByFields - default to ASCENDING
    • withOrderByField

      public QPossibleValueSource withOrderByField(String fieldName, boolean isAscending)
      Fluent setter for orderByFields
    • getEnumValues

      public List<QPossibleValue<?>> getEnumValues()
      Getter for enumValues
    • setEnumValues

      public void setEnumValues(List<QPossibleValue<?>> enumValues)
      Setter for enumValues
    • withEnumValues

      public QPossibleValueSource withEnumValues(List<QPossibleValue<?>> enumValues)
      Fluent setter for enumValues
    • addEnumValue

      public void addEnumValue(QPossibleValue<?> possibleValue)
    • withValuesFromEnum

      public <I extends Serializable, T extends PossibleValueEnum<I>> QPossibleValueSource withValuesFromEnum(T[] values)
      This is the easiest way to add the values from an enum to a PossibleValueSource. Make sure the enum implements PossibleValueEnum - then call as: myPossibleValueSource.withValuesFromEnum(MyEnum.values()));
    • getCustomCodeReference

      public QCodeReference getCustomCodeReference()
      Getter for customCodeReference
    • setCustomCodeReference

      public void setCustomCodeReference(QCodeReference customCodeReference)
      Setter for customCodeReference
    • withCustomCodeReference

      public QPossibleValueSource withCustomCodeReference(QCodeReference customCodeReference)
      Fluent setter for customCodeReference
    • setValueFormatAndFields

      public void setValueFormatAndFields(PVSValueFormatAndFields valueFormatAndFields)
    • withValueFormatAndFields

      public QPossibleValueSource withValueFormatAndFields(PVSValueFormatAndFields valueFormatAndFields)
    • addSelfToInstance

      public void addSelfToInstance(QInstance qInstance)
      Description copied from interface: MetaDataProducerOutput
      call the appropriate methods on a QInstance to add ourselves to it.
      Specified by:
      addSelfToInstance in interface MetaDataProducerOutput
      Specified by:
      addSelfToInstance in interface TopLevelMetaDataInterface
    • getOverrideIdField

      public String getOverrideIdField()
      Getter for overrideIdField
    • setOverrideIdField

      public void setOverrideIdField(String overrideIdField)
      Setter for overrideIdField
    • withOverrideIdField

      public QPossibleValueSource withOverrideIdField(String overrideIdField)
      Fluent setter for overrideIdField
    • getIdType

      public QFieldType getIdType()
      Getter for idType
    • setIdType

      public void setIdType(QFieldType idType)
      Setter for idType
    • withIdType

      public QPossibleValueSource withIdType(QFieldType idType)
      Fluent setter for idType