Enum WikiDataItem

    • Method Detail

      • values

        public static WikiDataItem[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (WikiDataItem c : WikiDataItem.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static WikiDataItem valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • fromValue

        public static WikiDataItem fromValue​(java.lang.String value)
        Get a well-known wiki data item from a value
        Parameters:
        value - The value to look for
        Returns:
        A WikiDataItem or null
      • getDescriptor

        public java.lang.String getDescriptor()
        Specified by:
        getDescriptor in interface WikiItemInterface
        Returns:
        The base description for the wiki item
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface WikiItemInterface
        Returns:
        The unique ID for the wiki item
      • getParent

        @Nullable
        public WikiDataItem getParent()
        Get the parent WikiDataItem for this, if any
        Returns:
        The parent item or null
      • matches

        public boolean matches​(java.lang.Object other)
        Check if the object matches this (essentially "equals")
        Parameters:
        other - The object to check
        Returns:
        true if the object is the same enum OR it is a string that matches the description (ignoring case).
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<WikiDataItem>