1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package dev.metaschema.core.metapath.item.function;
7   
8   import edu.umd.cs.findbugs.annotations.NonNull;
9   
10  /**
11   * An {@link IMapItem} key based on a text value.
12   */
13  public interface IStringMapKey extends IMapKey {
14    /**
15     * Get the item's string value.
16     *
17     * @return the string value value of the item
18     */
19    @NonNull
20    String asString();
21  
22    @Override
23    default boolean isSameKey(IMapKey other) {
24      // TODO: implement fn:codepoint-equal per spec
25      return other instanceof IStringMapKey
26          && asString().equals(((IStringMapKey) other).asString());
27    }
28  }