Enum PropertyStyle

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PropertyStyle>

    public enum PropertyStyle
    extends java.lang.Enum<PropertyStyle>
    An enumeration of property styles.

    A property may be read-only, read-write or write-only. This enumeration models those options.

    It is strongly recommended to use the methods, not compare against the enum values.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DERIVED
      The property is derived.
      IMMUTABLE
      The property is immutable.
      READ_ONLY
      The property is read-only.
      READ_ONLY_BUILDABLE
      The property is read-only but can be written via the builder.
      READ_WRITE
      The property can be read and written.
      WRITE_ONLY
      The property is write-only.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isBuildable()
      Checks whether the property can be used in the builder.
      boolean isDerived()
      Checks whether the property is derived.
      boolean isReadable()
      Checks whether the property is readable.
      boolean isReadOnly()
      Checks whether the property is read-only.
      boolean isSerializable()
      Checks whether the property can be serialized in a round-trip.
      boolean isWritable()
      Checks whether the property is writable.
      static PropertyStyle valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static PropertyStyle[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • READ_WRITE

        public static final PropertyStyle READ_WRITE
        The property can be read and written.
      • READ_ONLY

        public static final PropertyStyle READ_ONLY
        The property is read-only.
      • WRITE_ONLY

        public static final PropertyStyle WRITE_ONLY
        The property is write-only.
      • READ_ONLY_BUILDABLE

        public static final PropertyStyle READ_ONLY_BUILDABLE
        The property is read-only but can be written via the builder.
      • DERIVED

        public static final PropertyStyle DERIVED
        The property is derived. It is read-only.
      • IMMUTABLE

        public static final PropertyStyle IMMUTABLE
        The property is immutable. It can be read and written via the builder.
    • Method Detail

      • values

        public static PropertyStyle[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PropertyStyle c : PropertyStyle.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PropertyStyle valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isReadable

        public boolean isReadable()
        Checks whether the property is readable.

        This checks if the property get method will succeed.

        Returns:
        true if the property can be read
      • isWritable

        public boolean isWritable()
        Checks whether the property is writable.

        This checks if the property set method will succeed.

        Returns:
        true if the property can be written
      • isReadOnly

        public boolean isReadOnly()
        Checks whether the property is read-only.

        This checks if the property get method will succeed and the set method fail. Read-only, derived and immutable properties will return true. Note that an immutable property can be written via the builder.

        Returns:
        true if the property is derived
      • isBuildable

        public boolean isBuildable()
        Checks whether the property can be used in the builder.

        To check for round-trip behavior, use isSerializable().

        Returns:
        true if the property can be used in the builder
      • isDerived

        public boolean isDerived()
        Checks whether the property is derived.

        A derived property has no instance variable.

        Returns:
        true if the property is derived
      • isSerializable

        public boolean isSerializable()
        Checks whether the property can be serialized in a round-trip.

        A property that is read-write or immutable can be round-trip serialized.

        Returns:
        true if the property is serializable