Interface DateField<F extends DateField<F>>
- All Superinterfaces:
Comparable<F>,Component<F>,Copyable<F>,Field<F>,FormComponent<F>,Serializable
- All Known Implementing Classes:
DefaultDateField
Represents the metadata for a date picker field.
- Author:
- Dima Myroniuk (dmyroniuk)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic enum -
Method Summary
Modifier and TypeMethodDescriptiondefault FdateFormat(String format) Adds theDateField.Attributes.DATE_FORMATattribute.default FdefaultEndOf(DateField.DateStartUnit endUnit) Use the current date default ending at the particular unit.default FRepresents a default value for a date set to the exact moment it is generated on the frontenddefault FdefaultStartOf(DateField.DateStartUnit startUnit) Use the current date default starting at the particular unit.Finds theDateColumn.Attributes.DATE_FORMATattribute.default StringGets theDateField.Attributes.DATE_FORMATattribute.default booleanChecks whether theDateField.Attributes.DATE_FORMATattribute has been set.default FRemoves theDateField.Attributes.DATE_FORMATattribute.default FvalidateIsAfter(String messageKey, Object... arg) Creates a validation schema to verify that a date in this field is after a date in another field.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.broadleafcommerce.metadata.dsl.core.Component
addAction, addAction, addComponent, addEndpoint, addEndpoint, apply, attribute, augmentationKey, classifier, clearConditionals, clearEndpoints, conditional, conditionals, description, description, findAction, findAction, findActions, findAttribute, findComponent, findComponent, findComponents, findEndpoint, findEndpoint, findEndpoints, get, get, getAction, getAction, getActions, getActionsList, getAttribute, getAttribute, getAttributes, getAugmentationKey, getClassifier, getComponent, getComponent, getComponents, getComponentsList, getConditionals, getDescription, getEndpoint, getEndpoint, getEndpoints, getEndpointsList, getId, getLabel, getOrder, getScope, getType, hasAction, hasAttribute, hasComponent, hasEndpoint, id, isAugmentable, isTranslatable, label, label, notTranslatable, order, removeAction, removeAttribute, removeComponent, removeEndpoint, scope, self, setActions, setAttributes, setAugmentationKey, setClassifier, setComponents, setConditionals, setDescription, setEndpoints, setId, setLabel, setOrder, setScope, setTranslatable, setType, translatable, translatable, typeMethods inherited from interface com.broadleafcommerce.metadata.dsl.core.Field
clearReadOnlyConditionals, decorated, defaultValue, getDefaultValue, getName, getPlaceholder, getReadOnlyConditionals, getRequiredMessage, getValidationSchema, isReadOnly, isRequired, isShowInQueryBuilder, isTargetCollection, name, notReadOnly, notRequired, placeholder, placeholder, readOnly, readOnly, readOnlyConditional, readOnlyConditionals, required, required, required, required, requiredMessage, requiredMessage, setDefaultValue, setName, setPlaceholder, setReadOnly, setReadOnlyConditionals, setRequired, setRequiredMessage, setShowInQueryBuilder, setValidationSchema, targetIsCollection, targetIsNotCollection, validationMethod, validationSchema, validationSchemaMethods inherited from interface com.broadleafcommerce.metadata.dsl.core.FormComponent
getHelpText, getHint, getTooltip, helpText, helpText, hidden, hidden, hint, hint, isHidden, notHidden, setHelpText, setHidden, setHint, setTooltip, tooltip, tooltip
-
Method Details
-
defaultNow
Represents a default value for a date set to the exact moment it is generated on the frontend- Returns:
- this field for further customization
-
defaultStartOf
Use the current date default starting at the particular unit.defaultStartOf(DateStartUnit.YEAR)= 2018-01-01 00:00:00defaultStartOf(DateStartUnit.HOUR)= 2018-07-12 09:00:00
- Parameters:
startUnit- the unit the default date should start at, never null- Returns:
- this field for further customization
-
defaultEndOf
Use the current date default ending at the particular unit. Examples of how the frontend will intepret certain values:defaultEndOf(DateStartUnit.YEAR)= 2018-12-31 23:59:59defaultEndOf(DateStartUnit.HOUR)= 2018-07-12 09:59:00
- Parameters:
endUnit- the unit the default date should end, never null- Returns:
- this field for further customization
-
validateIsAfter
Creates a validation schema to verify that a date in this field is after a date in another field.- Parameters:
messageKey- the message key of the validation errorarg- the arguments for the validation method- Returns:
- this field for further customization
-
dateFormat
Adds theDateField.Attributes.DATE_FORMATattribute.- Parameters:
format- The format to set. SeeDateFormatTypes- Returns:
this
-
getDateFormat
Gets theDateField.Attributes.DATE_FORMATattribute.- Returns:
- the value of the attribute
-
findDateFormat
Finds theDateColumn.Attributes.DATE_FORMATattribute.- Returns:
- the value of the attribute or
Optional.empty()if not present.
-
removeDateFormat
Removes theDateField.Attributes.DATE_FORMATattribute.- Returns:
this
-
hasDateFormat
default boolean hasDateFormat()Checks whether theDateField.Attributes.DATE_FORMATattribute has been set.- Returns:
- Whether the attribute is set.
-