org.wildfly.swarm.spi.api.config

## Class CompositeKey

- java.lang.Object
- - org.wildfly.swarm.spi.api.config.CompositeKey

- All Implemented Interfaces:
    ConfigKey

      public class CompositeKey
      extends Object
      implements ConfigKey

  A multi-segment configuration key.
  Author:
    Bob McWhirter

- - ### Field Summary

    - ### Fields inherited from interface org.wildfly.swarm.spi.api.config.ConfigKey

      `EMPTY, END_DELIM, START_DELIM`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositeKey()`
    `CompositeKey(CompositeKey parent, ConfigKey child)`
    `CompositeKey(CompositeKey parent, String child)`
    `CompositeKey(SimpleKey... parts)`
    `CompositeKey(String... parts)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CompositeKey` | `append(ConfigKey key)` Return a new key with the given key appended.
    `CompositeKey` | `append(String... names)` Return a new key with the given segments appended.
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `SimpleKey` | `head()` Return the first segment of this key.
    `boolean` | `isChildOf(ConfigKey possibleParent)` Determine if this key is a child of the argument.
    `String` | `name()` String representation of this key's name.
    `String` | `propertyName()` String representation of this key's name in property format.
    `void` | `replace(int position, String name)`
    `ConfigKey` | `subkey(int offset)` Return the subkey of this key from a given offset.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.wildfly.swarm.spi.api.config.ConfigKey

      `of, parse`

- - ### Constructor Detail

    - #### CompositeKey

          public CompositeKey()

    - #### CompositeKey

          public CompositeKey(SimpleKey... parts)

    - #### CompositeKey

          public CompositeKey(String... parts)

    - #### CompositeKey

          public CompositeKey(CompositeKey parent,
                              ConfigKey child)

    - #### CompositeKey

          public CompositeKey(CompositeKey parent,
                              String child)

  - ### Method Detail

    - #### isChildOf

          public boolean isChildOf(ConfigKey possibleParent)

      Description copied from interface: `ConfigKey`
      Determine if this key is a child of the argument.
      Specified by:
        `isChildOf` in interface `ConfigKey`
      Parameters:
        `possibleParent` - The possible parent key.
      Returns:
        `true` if this key is a child of the argument, otherwise `false`.

    - #### replace

          public void replace(int position,
                              String name)

      Specified by:
        `replace` in interface `ConfigKey`

    - #### head

          public SimpleKey head()

      Description copied from interface: `ConfigKey`
      Return the first segment of this key.
      Specified by:
        `head` in interface `ConfigKey`
      Returns:
        The first segment of this key.

    - #### subkey

          public ConfigKey subkey(int offset)

      Description copied from interface: `ConfigKey`
      Return the subkey of this key from a given offset.
      Specified by:
        `subkey` in interface `ConfigKey`
      Parameters:
        `offset` - The number of segments offset from the head to subkey.
      Returns:
        The subkey or `ConfigKey.EMPTY`.

    - #### name

          public String name()

      Description copied from interface: `ConfigKey`
      String representation of this key's name.
      Specified by:
        `name` in interface `ConfigKey`
      Returns:
        The name.

    - #### propertyName

          public String propertyName()

      Description copied from interface: `ConfigKey`
      String representation of this key's name in property format.
      Specified by:
        `propertyName` in interface `ConfigKey`
      Returns:
        The name in property format.

    - #### append

          public CompositeKey append(String... names)

      Description copied from interface: `ConfigKey`
      Return a new key with the given segments appended.
      Specified by:
        `append` in interface `ConfigKey`
      Parameters:
        `names` - The segments to append.
      Returns:
        The new key.

    - #### append

          public CompositeKey append(ConfigKey key)

      Description copied from interface: `ConfigKey`
      Return a new key with the given key appended.
      Specified by:
        `append` in interface `ConfigKey`
      Parameters:
        `key` - The key to append.
      Returns:
        The new key.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2017 JBoss by Red Hat. All rights reserved.