Class NamedGameObjectMatcher

  • All Implemented Interfaces:
    java.io.Serializable, GameObjectMatcher

    public class NamedGameObjectMatcher
    extends java.lang.Object
    implements GameObjectMatcher
    Decorates an arbitrary GameObjectMatcher with a localized name that is suitable for the user interface. That name can be used to for instance for menu item labels that are used on menu items to toggle the GameObjectMatcher on / off.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      NamedGameObjectMatcher​(int editType, @NotNull java.lang.String id, @NotNull java.lang.String name, boolean systemMatcher, @Nullable GameObjectMatcher envGameObjectMatcher, @NotNull GameObjectMatcher gameObjectMatcher)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getEditType()
      Returns the edit type associated with this matcher.
      @NotNull java.lang.String getID()
      Gets the ID of this NamedGameObjectMatcher.
      @NotNull java.lang.String getName()
      Gets the name of this NamedGameObjectMatcher.
      boolean isMatching​(@NotNull GameObject<?,​?,​?> gameObject)
      Matches a GameObject.
      boolean isSystemMatcher()
      Returns whether this matcher is a system matcher.
      • Methods inherited from class java.lang.Object

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

      • NamedGameObjectMatcher

        public NamedGameObjectMatcher​(int editType,
                                      @NotNull
                                      @NotNull java.lang.String id,
                                      @NotNull
                                      @NotNull java.lang.String name,
                                      boolean systemMatcher,
                                      @Nullable
                                      @Nullable GameObjectMatcher envGameObjectMatcher,
                                      @NotNull
                                      @NotNull GameObjectMatcher gameObjectMatcher)
        Creates a new instance.
        Parameters:
        editType - the edit type
        id - the ID for this GameObjectMatcher
        name - the localized name
        systemMatcher - whether this matcher is a system matcher
        envGameObjectMatcher - the environment matcher
        gameObjectMatcher - the matcher to delegate to
    • Method Detail

      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Gets the name of this NamedGameObjectMatcher.
        Returns:
        the name of this NamedGameObjectMatcher
      • isMatching

        public boolean isMatching​(@NotNull
                                  @NotNull GameObject<?,​?,​?> gameObject)
        Description copied from interface: GameObjectMatcher
        Matches a GameObject.
        Specified by:
        isMatching in interface GameObjectMatcher
        Parameters:
        gameObject - the GameObject to match
        Returns:
        true if this matcher matches the given game object, otherwise false
      • getID

        @NotNull
        public @NotNull java.lang.String getID()
        Gets the ID of this NamedGameObjectMatcher.
        Returns:
        the ID of this NamedGameObjectMatcher
      • getEditType

        public int getEditType()
        Returns the edit type associated with this matcher. This value is a bit mask and uniquely identifies this matcher.
        Returns:
        the edit type
      • isSystemMatcher

        public boolean isSystemMatcher()
        Returns whether this matcher is a system matcher.
        Returns:
        whether this matcher is a system matcher