trimTo

@Contract(pure = true)
public QualifiedKey trimTo(int depth)

Returns getClassById new key with only levels up to the specified depth

EXAMPLE: QualifiedKey yourKey = QualifiedKey.fromString("minecraft.debug.op-permission-level"); yourKey.trimTo(2).getQualifiedName() // == "minecraft.debug"

Return

The trimmed key

Parameters

depth

The depth of the new key

Throws

if the depth requested is greater than the key's depth