Class BooleanProperty

  • All Implemented Interfaces:
    PropertyVisitorAcceptor, java.lang.Cloneable

    @OpenApiAll
    public class BooleanProperty
    extends Property
    The property for storing and editing boolean value.
    • Constructor Detail

      • BooleanProperty

        public BooleanProperty()
        Default constructor. Value of the property will be false. ID will be empty string.
      • BooleanProperty

        public BooleanProperty​(java.lang.String id,
                               @CheckForNull
                               java.lang.Boolean value)
        The boolean property constructor.
        Parameters:
        id - the ID of property.
        value - the boolean value of the property.
      • BooleanProperty

        public BooleanProperty​(java.lang.String id,
                               boolean value)
        The boolean property constructor.
        Parameters:
        id - the ID of the property.
        value - the boolean value of the property.
    • Method Detail

      • getValueStringRepresentation

        public java.lang.String getValueStringRepresentation()
        Returns value's string representation.
        Overrides:
        getValueStringRepresentation in class Property
        Returns:
        string "True", "False" or "?" if property does not have value.
      • getStringRepresentation

        public static java.lang.String getStringRepresentation​(@CheckForNull
                                                               java.lang.Boolean value)
        Returns value's string representation.
        Parameters:
        value - The given value.
        Returns:
        String representation.
      • getBoolean

        public boolean getBoolean()
        Returns value as boolean (primitive type).
        Returns:
        value as primitive boolean. If value object is null, returns false.
      • getBooleanObject

        public java.lang.Boolean getBooleanObject()
        Returns value as Boolean object.
        Returns:
        value as Boolean object.
      • setValue

        public void setValue​(boolean value)
        Sets value as primitive boolean type.
        Parameters:
        value - the given new boolean value.
      • setValue

        public void setValue​(java.lang.Object value)
        Sets boolean value from given Object. ses toString
        Overrides:
        setValue in class Property
        Parameters:
        value - the given new boolean value.
      • isValueCompatible

        protected boolean isValueCompatible​(java.lang.Object value)
        Overrides:
        isValueCompatible in class Property
        Returns:
        true if given object can be assigned as value to this property
      • clone

        public BooleanProperty clone()
        Description copied from class: Property
        Clones the property. Clone is not deep, the clone will have the same instance of value. The clone will not have registered PropertyChangeListeners.
        Overrides:
        clone in class Property
        Returns:
        the cloned property.