Class AdaptiveIntProperty

java.lang.Object
dev.prozilla.pine.common.property.adaptive.AdaptiveProperty<Integer,IntProperty>
dev.prozilla.pine.common.property.adaptive.AdaptiveIntProperty
All Implemented Interfaces:
Animatable, IntProperty, NonNullProperty<Integer>, Property<Integer>, Functor<Integer>

public final class AdaptiveIntProperty extends AdaptiveProperty<Integer,IntProperty> implements IntProperty
An optimized adaptive property, that uses a primitive int value.
  • Constructor Details

    • AdaptiveIntProperty

      public AdaptiveIntProperty(IntProperty property)
      Creates a new property with a dynamic value.
      Parameters:
      property - Variable property that determines the value of this property
    • AdaptiveIntProperty

      public AdaptiveIntProperty(int fixedValue)
      Creates a new property with a fixed value.
  • Method Details

    • get

      public int get()
      Description copied from interface: IntProperty
      Returns the primitive value of this property.
      Specified by:
      get in interface IntProperty
      Returns:
      The primitive value of this property.
    • adapt

      public static AdaptiveIntProperty adapt(int value)
      Converts an integer into an adaptive property.
      Parameters:
      value - The value of the property
    • adapt

      public static AdaptiveIntProperty adapt(AdaptiveIntProperty property)
    • adapt

      public static AdaptiveIntProperty adapt(IntProperty property)
      Converts any integer property into an adaptive property.
      Parameters:
      property - The property to adapt