public enum BuiltinMacs extends Enum<BuiltinMacs> implements MacFactory
Modifier and Type | Class and Description |
---|---|
static class |
BuiltinMacs.Constants |
static class |
BuiltinMacs.ParseResult |
BuiltinFactory.Utils
Enum Constant and Description |
---|
hmacmd5 |
hmacmd596 |
hmacsha1 |
hmacsha196 |
hmacsha256 |
hmacsha512 |
Modifier and Type | Field and Description |
---|---|
static Set<BuiltinMacs> |
VALUES |
BY_NAME_COMPARATOR, NAME_EXTRACTOR
FALSE, TRUE
Modifier and Type | Method and Description |
---|---|
Mac |
create() |
static BuiltinMacs |
fromFactory(NamedFactory<Mac> factory) |
static BuiltinMacs |
fromFactoryName(String name) |
static BuiltinMacs |
fromString(String s) |
String |
getAlgorithm() |
int |
getBlockSize() |
int |
getDefaultBlockSize() |
String |
getName() |
static SortedSet<MacFactory> |
getRegisteredExtensions() |
boolean |
isSupported() |
static BuiltinMacs.ParseResult |
parseMacsList(Collection<String> macs) |
static BuiltinMacs.ParseResult |
parseMacsList(String... macs) |
static BuiltinMacs.ParseResult |
parseMacsList(String macs) |
static void |
registerExtension(MacFactory extension)
Registered a
NamedFactory to be available besides the built-in
ones when parsing configuration |
static MacFactory |
resolveFactory(String name) |
String |
toString() |
static MacFactory |
unregisterExtension(String name)
Unregisters specified extension
|
static BuiltinMacs |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BuiltinMacs[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BuiltinMacs hmacmd5
public static final BuiltinMacs hmacmd596
public static final BuiltinMacs hmacsha1
public static final BuiltinMacs hmacsha196
public static final BuiltinMacs hmacsha256
public static final BuiltinMacs hmacsha512
public static final Set<BuiltinMacs> VALUES
public static BuiltinMacs[] values()
for (BuiltinMacs c : BuiltinMacs.values()) System.out.println(c);
public static BuiltinMacs valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic final String getName()
getName
in interface NamedResource
public final String getAlgorithm()
getAlgorithm
in interface MacInformation
public final int getBlockSize()
getBlockSize
in interface MacInformation
public final int getDefaultBlockSize()
getDefaultBlockSize
in interface MacInformation
public final boolean isSupported()
isSupported
in interface OptionalFeature
public final String toString()
toString
in class Enum<BuiltinMacs>
public static void registerExtension(MacFactory extension)
NamedFactory
to be available besides the built-in
ones when parsing configurationextension
- The factory to registerIllegalArgumentException
- if factory instance is null
,
or overrides a built-in one or overrides another registered factory
with the same name (case insensitive).public static SortedSet<MacFactory> getRegisteredExtensions()
SortedSet
of the currently registered extensions, sorted
according to the factory name (case insensitive)public static MacFactory unregisterExtension(String name)
name
- The factory name - ignored if null
/emptynull
if not foundpublic static BuiltinMacs fromString(String s)
s
- The Enum
's name - ignored if null
/emptyBuiltinMacs
whose Enum.name()
matches
(case insensitive) the provided argument - null
if no matchpublic static BuiltinMacs fromFactory(NamedFactory<Mac> factory)
factory
- The NamedFactory
for the MAC - ignored if null
BuiltinMacs
whose factory name matches
(case insensitive) the digest factory namefromFactoryName(String)
public static BuiltinMacs fromFactoryName(String name)
name
- The factory name - ignored if null
/emptyBuiltinMacs
whose factory name matches
(case insensitive) the provided name - null
if no matchpublic static BuiltinMacs.ParseResult parseMacsList(String macs)
macs
- A comma-separated list of MACs' names - ignored
if null
/emptyBuiltinMacs.ParseResult
containing the successfully parsed
factories and the unknown ones. Note: it is up to caller to
ensure that the lists do not contain duplicatespublic static BuiltinMacs.ParseResult parseMacsList(String... macs)
public static BuiltinMacs.ParseResult parseMacsList(Collection<String> macs)
public static MacFactory resolveFactory(String name)
name
- The factory namenull
if it is neither a built-in one
or a registered extensionCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.