Interface Keys


@Internal public interface Keys
A reusable key set for known object keys.
Since:
3.1
Author:
Denis Stepanov
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Returned by indexOf(String) when a key is unknown.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Whether key matching should be case-insensitive.
    static Keys
    create(String... keys)
    Create a key set for the supplied keys.
    static Keys
    create(String[] keys, boolean caseInsensitive)
    Create a key set for the supplied keys.
    static Keys
    Create a key set for the supplied keys.
    static Keys
    create(List<String> keys, boolean caseInsensitive)
    Create a key set for the supplied keys.
    int
    Find the index of the supplied key.
  • Field Details

  • Method Details

    • create

      static Keys create(List<String> keys)
      Create a key set for the supplied keys.
      Parameters:
      keys - The keys
      Returns:
      The key set
    • create

      static Keys create(List<String> keys, boolean caseInsensitive)
      Create a key set for the supplied keys.
      Parameters:
      keys - The keys
      caseInsensitive - Whether key matching should be case-insensitive
      Returns:
      The key set
    • create

      static Keys create(String... keys)
      Create a key set for the supplied keys.
      Parameters:
      keys - The keys
      Returns:
      The key set
    • create

      static Keys create(String[] keys, boolean caseInsensitive)
      Create a key set for the supplied keys.
      Parameters:
      keys - The keys
      caseInsensitive - Whether key matching should be case-insensitive
      Returns:
      The key set
    • indexOf

      int indexOf(String key)
      Find the index of the supplied key.
      Parameters:
      key - The key
      Returns:
      The key index, or UNKNOWN_KEY if no key matches
    • caseInsensitive

      default boolean caseInsensitive()
      Whether key matching should be case-insensitive.
      Returns:
      True if key matching should ignore case