Promotion background
Easter Season IS HERE!
10% off limited time offer!
Ends in
00
H
00
M
00
S
limited time offer SAVE 10% NOW →
Packages com.phoenixplugins.phoenixcrates.api crate animation
com.phoenixplugins.phoenixcrates.api.crate.animation

Class AnimationProperties

  • java.lang.Object
    • com.phoenixplugins.phoenixcrates.api.crate.animation.AnimationProperties
  • All Implemented Interfaces:
    Cloneable


    public class AnimationProperties
    extends Object
    implements Cloneable
    Represents a collection of properties for configuring an animation. This class allows you to dynamically add, retrieve, and manipulate properties that affect the behavior of an animation.
    • Method Summary

      Modifier and Type Method and Description
      void addProperty(String key, Object value)
      Adds a property to the animation properties.
      AnimationProperties clone() 
      static AnimationProperties empty()
      Static method to create an empty AnimationProperties object.
      Color getColorOrDefault(String key, Color defaultValue) 
      <E extends Enum<E>>
      E
      getEnumOrDefault(String key, E defaultValue) 
      Object getProperty(String key)
      Retrieves a property by its key.
      <T> T getProperty(String key, Class<T> clazz)
      Retrieves a property by its key, with type conversion compatibility.
      <T> T getPropertyOrDefault(String key, T defaultValue)
      Retrieves a property by its key, with type conversion compatibility.
      boolean hasProperty(String key)
      Checks if a property exists in the animation properties.
      Map<String,Object> map() 
      static AnimationProperties of(Object... keyValuePairs)
      Static method to create an AnimationProperties object from alternating key-value pairs.
      void removeProperty(String key)
      Removes a property from the animation properties.
      void resetProperties()
      Resets all properties in this animation to their default values.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • empty

        public static AnimationProperties empty()
        Static method to create an empty AnimationProperties object.
        Returns:
        A new empty AnimationProperties object.
      • of

        public static AnimationProperties of(Object... keyValuePairs)
        Static method to create an AnimationProperties object from alternating key-value pairs. The key and value pairs are passed as Object arguments.
        Parameters:
        keyValuePairs - An array of alternating keys and values for the properties.
        Returns:
        A new AnimationProperties object with the provided key-value pairs.
      • addProperty

        public void addProperty(String key,
                                Object value)
        Adds a property to the animation properties.
        Parameters:
        key - The key for the property.
        value - The value of the property.
      • getProperty

        public Object getProperty(String key)
        Retrieves a property by its key.
        Parameters:
        key - The key of the property.
        Returns:
        The value of the property, or null if not found.
      • getProperty

        public <T> T getProperty(String key,
                                 Class<T> clazz)
        Retrieves a property by its key, with type conversion compatibility. It supports auto-conversion of compatible types (e.g., Integer to Double, String to Boolean, etc.).
        Type Parameters:
        T - The type to cast the property to.
        Parameters:
        key - The key of the property.
        clazz - The class type to cast the property value to.
        Returns:
        The property value as the specified type, or null if not found or cannot be converted.
      • getPropertyOrDefault

        public <T> T getPropertyOrDefault(String key,
                                          @NonNull
                                          T defaultValue)
        Retrieves a property by its key, with type conversion compatibility. It supports auto-conversion of compatible types (e.g., Integer to Double, String to Boolean, etc.). If the property does not exist, the default value is returned.
        Type Parameters:
        T - The type of the default value (and the type to cast the property to).
        Parameters:
        key - The key of the property.
        defaultValue - The default value to return if the property doesn't exist.
        Returns:
        The property value as the specified type, or the default value if not found or cannot be converted.
      • getColorOrDefault

        public Color getColorOrDefault(String key,
                                       Color defaultValue)
      • getEnumOrDefault

        public <E extends Enum<E>> E getEnumOrDefault(String key,
                                                      E defaultValue)
      • hasProperty

        public boolean hasProperty(String key)
        Checks if a property exists in the animation properties.
        Parameters:
        key - The key of the property to check.
        Returns:
        true if the property exists, false otherwise.
      • removeProperty

        public void removeProperty(String key)
        Removes a property from the animation properties.
        Parameters:
        key - The key of the property to remove.
      • resetProperties

        public void resetProperties()
        Resets all properties in this animation to their default values.
      • map

        public Map<String,Object> map()
Last updated about 3 hours ago
My Cart (0 items)

Oops... looks like the spiders padded through here

Add products to your cart and remove them from here Lets buy
This site uses cookies to personalize content, enhance your experience. By continuing, you agree to our cookie use. Learn more