Interface Property.Builder<T,​B extends Property.Builder<T,​B>>

    • Method Detail

      • attribute

        Attribute<T> attribute()
        Returns:
        the underying attribute
      • captionResourceKey

        B captionResourceKey​(String captionResourceKey)
        Specifies the resource bundle from which to retrieve the caption for this property, assuming the resource key is the attribute name (Attribute.name()). Note that this sets the property to be not hidden.
        Parameters:
        captionResourceKey - the caption resource bundle key
        Returns:
        this instance
        Throws:
        IllegalStateException - in case the caption has already been set
        IllegalStateException - in case no resource bundle is specified for the entity
        IllegalStateException - in case the caption resource is not found in the entity resource bundle
        See Also:
        EntityType.resourceBundleName()
      • beanProperty

        B beanProperty​(String beanProperty)
        Sets the bean name property to associate with this property
        Parameters:
        beanProperty - the bean property name
        Returns:
        this instance
      • defaultValue

        B defaultValue​(T defaultValue)
        Sets the default value for this property, overrides the underlying column default value, if any
        Parameters:
        defaultValue - the value to use as default
        Returns:
        this instance
      • defaultValueSupplier

        B defaultValueSupplier​(Property.ValueSupplier<T> supplier)
        Sets the default value supplier, use in case of dynamic default values.
        Parameters:
        supplier - the default value supplier
        Returns:
        this instance
      • hidden

        B hidden​(boolean hidden)
        Specifies whether this property should be hidden in table views
        Parameters:
        hidden - true if this property should be hidden
        Returns:
        this instance
      • minimumValue

        B minimumValue​(Number minimumValue)
        Only applicable to numerical properties
        Parameters:
        minimumValue - the minimum allowed value for this property
        Returns:
        this instance
        Throws:
        IllegalStateException - in case this is not a numerical property
      • maximumValue

        B maximumValue​(Number maximumValue)
        Only applicable to numerical properties
        Parameters:
        maximumValue - the maximum allowed value for this property
        Returns:
        this instance
        Throws:
        IllegalStateException - in case this is not a numerical property
      • valueRange

        B valueRange​(Number minimumValue,
                     Number maximumValue)
        Only applicable to numerical properties
        Parameters:
        minimumValue - the minimum allowed value for this property
        maximumValue - the maximum allowed value for this property
        Returns:
        this instance
        Throws:
        IllegalStateException - in case this is not a numerical property
      • maximumFractionDigits

        B maximumFractionDigits​(int maximumFractionDigits)
        Sets the maximum fraction digits to show for this property, only applicable to properties based on decimal types. This setting is overridden during subsequent calls to format(Format). Note that values associated with this property are automatically rounded to maximumFractionDigits digits.
        Parameters:
        maximumFractionDigits - the maximum fraction digits
        Returns:
        this instance
        Throws:
        IllegalStateException - in case this is not a decimal property
        See Also:
        decimalRoundingMode(RoundingMode)
      • decimalRoundingMode

        B decimalRoundingMode​(RoundingMode decimalRoundingMode)
        Sets the rounding mode to use when working with decimals
        Parameters:
        decimalRoundingMode - the rounding mode
        Returns:
        this instance
        Throws:
        IllegalStateException - in case this is not a decimal property
        See Also:
        maximumFractionDigits(int)
      • numberFormatGrouping

        B numberFormatGrouping​(boolean numberFormatGrouping)
        Specifies whether to use number grouping when presenting the value associated with this property. i.e. 1234567 shown as 1.234.567 or 1,234,567 depending on locale. By default, grouping is not used. Only applicable to numerical properties. This setting is overridden during subsequent calls to format(Format)
        Parameters:
        numberFormatGrouping - if true then number grouping is used
        Returns:
        this instance
        Throws:
        IllegalStateException - in case this is not a numerical property
      • preferredColumnWidth

        B preferredColumnWidth​(int preferredColumnWidth)
        Specifies the preferred column width when displaying this property in a table.
        Parameters:
        preferredColumnWidth - the preferred column width of this property in pixels when displayed in a table
        Returns:
        this instance
        Throws:
        IllegalArgumentException - in case the value is less than 1
      • nullable

        B nullable​(boolean nullable)
        Specifies whether this property is nullable. Note that this will not prevent the value from being set to null, only prevent successful validation of the entity.
        Parameters:
        nullable - specifies whether null is a valid value for this property
        Returns:
        this instance
      • maximumLength

        B maximumLength​(int maximumLength)
        Sets the maximum length of this property value, this applies to String (varchar) based properties
        Parameters:
        maximumLength - the maximum length
        Returns:
        this instance
        Throws:
        IllegalStateException - in case this is not a String property
      • mnemonic

        B mnemonic​(Character mnemonic)
        Sets the mnemonic to use when creating a label for this property
        Parameters:
        mnemonic - the mnemonic character
        Returns:
        this instance
      • description

        B description​(String description)
        Sets the description for this property, used for tooltips f.ex.
        Parameters:
        description - a String describing this property
        Returns:
        this instance
      • comparator

        B comparator​(Comparator<T> comparator)
        Parameters:
        comparator - the Comparator to use when comparing values for this attribute
        Returns:
        this instance
      • build

        Property<T> build()
        Builds a new Property instance
        Returns:
        a new property instance based on this builder