Interface IntProperty

All Superinterfaces:
Functor<Integer>, NonNullProperty<Integer>, Property<Integer>
All Known Subinterfaces:
MutableIntProperty, ObservableIntProperty
All Known Implementing Classes:
AdaptiveIntProperty, AnimatedIntProperty, DeserializedIntProperty, FixedIntProperty, IntConfigOption, LocalRandomIntProperty, RandomIntProperty, RangedMutableIntProperty, SimpleMutableIntProperty, SimpleObservableIntProperty, StoredIntProperty, StyledIntProperty, TransitionedIntProperty
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface IntProperty extends NonNullProperty<Integer>
A property with an integer value.
  • Method Details

    • getValueOr

      default Integer getValueOr(Integer defaultValue)
      Description copied from interface: Property
      Returns the value of this property, or defaultValue if the value is null.
      Specified by:
      getValueOr in interface Property<Integer>
      Parameters:
      defaultValue - The default value to use
      Returns:
      The value of this property, or defaultValue if the value is null.
    • requireValue

      @NotNull default @NotNull Integer requireValue()
      Description copied from interface: Property
      Returns the value of this property, if it is not null, otherwise throws an exception.
      Specified by:
      requireValue in interface Property<Integer>
      Returns:
      The value of this property
    • getValue

      default Integer getValue()
      Description copied from interface: Property
      Returns the value of this property.
      Specified by:
      getValue in interface Property<Integer>
      Returns:
      The value of this property.
    • get

      int get()
      Returns the primitive value of this property.
      Returns:
      The primitive value of this property.
    • has

      default boolean has(int value)
    • replaceNull

      @Contract("_ -> this") default IntProperty replaceNull(Integer defaultValue)
      Description copied from interface: NonNullProperty
      Returns this property, whose value is never null.
      Specified by:
      replaceNull in interface NonNullProperty<Integer>
      Specified by:
      replaceNull in interface Property<Integer>
      Returns:
      This property.
    • map

      default IntProperty map(IntMapper mapper)
    • isZeroProperty

      default BooleanProperty isZeroProperty()
      Returns a boolean property whose value is true if the value of this property is 0.
      Returns:
      A boolean property based on whether the value of this property is 0.
      See Also:
    • hasProperty

      default BooleanProperty hasProperty(int value)
      Returns a boolean property whose value is true if the value of this property is equal to value.
      Returns:
      A boolean property whose value is true if the value of this property is equal to value.
      See Also:
    • fromProperty

      static IntProperty fromProperty(IntProperty property)
    • fromProperty

      @Contract("_ -> new") static IntProperty fromProperty(Property<Integer> property)
    • getValueOf

      @Contract("null, _ -> param2") static int getValueOf(IntProperty property, int defaultValue)
      Returns the value of a given property, or a default value if the property is null.
      Parameters:
      property - The property or null
      defaultValue - The value to use in case the property is null.
      Returns:
      The value