public final class Prefixes extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Prefixes.PrefixPair
Represents a name with an optional vendor
Prefix . |
Modifier and Type | Method and Description |
---|---|
static Optional<Prefix> |
parsePrefix(String name)
Finds the vendor
Prefix at the start of the given string. |
static Prefixes.PrefixPair |
splitPrefix(String name)
Splits a string into the vendor
Prefix and unprefixed portions. |
static String |
unprefixed(String name)
Gets the unprefixed portion of the given name.
|
public static Optional<Prefix> parsePrefix(String name)
Prefix
at the start of the given string.public static Prefixes.PrefixPair splitPrefix(String name)
Prefix
and unprefixed portions.
If the string does not contain a prefix then the returned Prefixes.PrefixPair
will return an empty Optional
from the
Prefixes.PrefixPair.prefix()
method.
name
- Split this string.Prefixes.PrefixPair
instance, containing the Prefix
(if found) and the unprefixed portion.public static String unprefixed(String name)
If the name is not prefixed, it will be returned unchanged. If the name is prefixed, the unprefixed part of the name will be returned.
name
- Find the unprefixed part of this string.Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.