Class AttributeListUtils


  • public class AttributeListUtils
    extends java.lang.Object
    Utility class for archetype attribute related functions.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull java.lang.String diffArchTextKeys​(@NotNull BaseObject<?,​?,​?,​?> gameObject, @NotNull BaseObject<?,​?,​?,​?> archetype)
      Returns all attributes from the given game object that don't exist in an archetype.
      static @NotNull java.lang.String diffArchTextValues​(@NotNull BaseObject<?,​?,​?,​?> archetype, @NotNull java.lang.CharSequence attributes)
      Returns all entries from the given attributes that don't exist in an archetype.
      static java.lang.String removeAttribute​(@NotNull java.lang.String attributeList, @NotNull java.lang.String key)
      Removes an attribute from an attribute list.
      • Methods inherited from class java.lang.Object

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

      • removeAttribute

        public static java.lang.String removeAttribute​(@NotNull
                                                       @NotNull java.lang.String attributeList,
                                                       @NotNull
                                                       @NotNull java.lang.String key)
        Removes an attribute from an attribute list.
        Parameters:
        attributeList - the attribute list to modify
        key - the attribute key to remove
        Returns:
        the attribute list with the given key removed
      • diffArchTextKeys

        @NotNull
        public static @NotNull java.lang.String diffArchTextKeys​(@NotNull
                                                                 @NotNull BaseObject<?,​?,​?,​?> gameObject,
                                                                 @NotNull
                                                                 @NotNull BaseObject<?,​?,​?,​?> archetype)
        Returns all attributes from the given game object that don't exist in an archetype. Ignores the values; compares only keys.
        Parameters:
        gameObject - the game object
        archetype - the archetype
        Returns:
        all attributes from the archetype that don't occur in the game object
      • diffArchTextValues

        @NotNull
        public static @NotNull java.lang.String diffArchTextValues​(@NotNull
                                                                   @NotNull BaseObject<?,​?,​?,​?> archetype,
                                                                   @NotNull
                                                                   @NotNull java.lang.CharSequence attributes)
        Returns all entries from the given attributes that don't exist in an archetype.
        Parameters:
        attributes - the attributes
        archetype - the game object
        Returns:
        all lines from attributes that don't occur in this game object