Interface Attribute<T>

  • Type Parameters:
    T - the attribute type
    All Known Subinterfaces:
    ForeignKey

    public interface Attribute<T>
    Typed Attribute to base a Property on. Note that attribute names are case-sensitive and Attributes are equal if their names and entityTypes are equal, the valueClass does not factor into equality.
    • Method Detail

      • name

        String name()
        Returns:
        the name of this attribute.
      • valueClass

        Class<T> valueClass()
        Returns:
        the Class representing the attribute value
      • entityType

        EntityType entityType()
        Returns:
        the entity type this Attribute is associated with
      • validateType

        T validateType​(T value)
        Parameters:
        value - the value to validate
        Returns:
        the validated value
        Throws:
        IllegalArgumentException - in case value is of a type incompatible with this attribute
        See Also:
        valueClass()
      • isNumerical

        boolean isNumerical()
        Returns:
        true if this attribute represents a numerical value.
      • isTemporal

        boolean isTemporal()
        Returns:
        true if this attribute represents a Temporal value.
      • isLocalDate

        boolean isLocalDate()
        Returns:
        true if this attribute represents a LocalDate value.
      • isLocalDateTime

        boolean isLocalDateTime()
        Returns:
        true if this attribute represents a LocalDateTime value.
      • isLocalTime

        boolean isLocalTime()
        Returns:
        true if this attribute represents a LocalTime value.
      • isOffsetDateTime

        boolean isOffsetDateTime()
        Returns:
        true if this attribute represents a OffsetDateTime value.
      • isCharacter

        boolean isCharacter()
        Returns:
        true if this attribute represents a Character value.
      • isString

        boolean isString()
        Returns:
        true if this attribute represents a String value.
      • isLong

        boolean isLong()
        Returns:
        true if this attribute represents a Long value.
      • isInteger

        boolean isInteger()
        Returns:
        true if this attribute represents a Integer value.
      • isShort

        boolean isShort()
        Returns:
        true if this attribute represents a Short value.
      • isDouble

        boolean isDouble()
        Returns:
        true if this attribute represents a Double value.
      • isBigDecimal

        boolean isBigDecimal()
        Returns:
        true if this attribute represents a BigDecimal value.
      • isDecimal

        boolean isDecimal()
        Returns:
        true if this attribute represents a decimal number value.
      • isBoolean

        boolean isBoolean()
        Returns:
        true if this attribute represents a Boolean value.
      • isByteArray

        boolean isByteArray()
        Returns:
        true if this attribute represents a byte array value.
      • isEntity

        boolean isEntity()
        Returns:
        true if this attribute represents a Entity value.
      • attribute

        static <T> Attribute<T> attribute​(EntityType entityType,
                                          String name,
                                          Class<T> valueClass)
        Creates a new Attribute, associated with the given entityType.
        Type Parameters:
        T - the attribute type
        Parameters:
        entityType - the entityType owning this attribute
        name - the attribute name
        valueClass - the class representing the attribute value type
        Returns:
        a new Attribute