All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.syntaxphoenix.syntaxapi.utils.key.INamedKey Maven / Gradle / Ivy

There is a newer version: 2.0.12
Show newest version
package com.syntaxphoenix.syntaxapi.utils.key;

public interface INamedKey extends IKey {

	String getName();

	default String asNamedString() {
		return String.format(KeyConstants.NAMED_KEY_FORMAT, getNamespace().getName(), getKey(), getName());
	}

	default int hashNamed() {
		return asNamedString().hashCode();
	}

	default boolean isSame(INamedKey key) {
		return isSimilar(key) && key.getName().equals(getName());
	}

	public static boolean isNamedKey(String string) {
		return KeyConstants.NAMED_KEY_PATTERN.matcher(string).matches();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy