Class Desc<T extends java.lang.Enum<T>,​V extends HasDesc<?>>

Type Parameters:
T - The enum representing the parameters/arguments/fields in the abstract base class.
V - The abstract base class of the concrete type.
All Implemented Interfaces:, java.lang.Cloneable, java.util.Map<T,​java.lang.Object>, HasDesc<Desc<T,​V>>, HasEntrySet<T,​java.lang.Object>
Direct Known Subclasses:
AuraDesc, CardCostModifierDesc, CardSourceDesc, ConditionDesc, DynamicDescriptionDesc, EntityFilterDesc, EventTriggerDesc, SpellDesc, ValueProviderDesc

public abstract class Desc<T extends java.lang.Enum<T>,​V extends HasDesc<?>>
extends BaseMap<T,​java.lang.Object>
implements, java.lang.Cloneable, HasDesc<Desc<T,​V>>, HasEntrySet<T,​java.lang.Object>
A map representing a complex type in Spellsource, like a Spell or Condition.
See Also:
for a walk through on how deserialization of card JSON works on subclasses of this one., Serialized Form
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.util.AbstractMap

    java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>

    Nested classes/interfaces inherited from interface

    HasEntrySet.BfsEnum, HasEntrySet.BfsNode<T extends java.lang.Enum,​V>

    Nested classes/interfaces inherited from interface java.util.Map

    java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
  • Constructor Summary

    Modifier Constructor Description
      Desc​(java.lang.Class<? extends V> clazz, java.lang.Class<T> keyType)  
    protected Desc​(java.lang.Class<T> keyType)  
    protected Desc​(java.util.Map<T,​java.lang.Object> arguments, java.lang.Class<T> keyType)  
  • Method Summary

    Modifier and Type Method Description
    abstract Desc<T,​V> clone()  
    protected Desc<T,​V> copyTo​(Desc<T,​V> clone)  
    V create()
    Per-instance memoized desc create instance.
    boolean equals​(java.lang.Object other)  
    boolean getBool​(T arg)  
    abstract T getClassArg()  
    Desc<T,​V> getDesc()  
    java.lang.Class<? extends V> getDescClass()  
    protected abstract java.lang.Class<? extends Desc> getDescImplClass()  
    int getInt​(T arg)  
    java.lang.String getString​(T arg)  
    int getValue​(T arg, GameContext context, Player player, Entity target, Entity host, int defaultValue)  
    int hashCode()  
    java.lang.Object put​(T key, java.lang.Object value)  
    void setDesc​(Desc<?,​?> desc)  
    java.lang.String toString()  

    Methods inherited from class java.util.EnumMap

    clear, containsKey, containsValue, entrySet, get, keySet, putAll, remove, size, values

    Methods inherited from class java.util.AbstractMap


    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface

    bfs, entrySet

    Methods inherited from interface java.util.Map

    compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
  • Constructor Details

    • Desc

      protected Desc​(java.util.Map<T,​java.lang.Object> arguments, java.lang.Class<T> keyType)
    • Desc

      protected Desc​(java.lang.Class<T> keyType)
    • Desc

      public Desc​(java.lang.Class<? extends V> clazz, java.lang.Class<T> keyType)
  • Method Details

    • getDescClass

      public java.lang.Class<? extends V> getDescClass()
    • getDescImplClass

      protected abstract java.lang.Class<? extends Desc> getDescImplClass()
    • create

      public V create()
      Per-instance memoized desc create instance.
      An instance of the underlying implementation of this desc.
    • getClassArg

      public abstract T getClassArg()
    • getBool

      public boolean getBool​(T arg)
    • getInt

      public int getInt​(T arg)
    • getString

      public java.lang.String getString​(T arg)
    • getValue

      @Suspendable public int getValue​(T arg, GameContext context, Player player, Entity target, Entity host, int defaultValue)
    • equals

      public boolean equals​(java.lang.Object other)
      Specified by:
      equals in interface java.util.Map<T extends java.lang.Enum<T>,​V extends HasDesc<?>>
      equals in class java.util.EnumMap<T extends java.lang.Enum<T>,​java.lang.Object>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface java.util.Map<T extends java.lang.Enum<T>,​V extends HasDesc<?>>
      hashCode in class java.util.EnumMap<T extends java.lang.Enum<T>,​java.lang.Object>
    • put

      public java.lang.Object put​(@NotNull T key, java.lang.Object value)
      Specified by:
      put in interface java.util.Map<T extends java.lang.Enum<T>,​V extends HasDesc<?>>
      put in class java.util.EnumMap<T extends java.lang.Enum<T>,​java.lang.Object>
    • clone

      public abstract Desc<T,​V> clone()
      clone in class BaseMap<T extends java.lang.Enum<T>,​java.lang.Object>
    • toString

      public java.lang.String toString()
      toString in class BaseMap<T extends java.lang.Enum<T>,​java.lang.Object>
    • copyTo

      protected Desc<T,​V> copyTo​(Desc<T,​V> clone)
    • getDesc

      public Desc<T,​V> getDesc()
      Specified by:
      getDesc in interface HasDesc<T extends java.lang.Enum<T>>
    • setDesc

      public void setDesc​(Desc<?,​?> desc)
      Specified by:
      setDesc in interface HasDesc<T extends java.lang.Enum<T>>