Serializable
, Comparable<SystemContext>
public enum SystemContext extends Enum<SystemContext>
Enum Constant | Description |
---|---|
APPLICATION |
Specifies an application specific granularity.
|
HOST |
Specifies a host specific granularity.
|
HOST_APPLICATION |
Specifies an application on a host specific granularity.
|
HOST_USER |
Specifies a user on a host specific granularity.
|
HOST_USER_APPLICATION |
Specifies an application for a user specific granularity.
|
USER |
Specifies a user specific granularity.
|
USER_APPLICATION |
Specifies a user specific granularity.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
isApplicationLevel() |
Determines whether the granularity is on an application level.
|
boolean |
isHostLevel() |
Determines whether the granularity is on a host level.
|
boolean |
isUserLevel() |
Determines whether the granularity is on a user level.
|
int |
toSystemId() |
Creates an ID most probably unique as specified by the provided argument
this method is invoked on.Succeeding calls of this method on the same
machine returns the same value.
|
int |
toSystemId(String aSeed) |
Creates an ID most probably unique as specified by the provided argument
this method is invoked on.
|
int[] |
toSystemIds(int aIdLength) |
Creates an array of IDs most probably unique as specified by the provided
argument this method is invoked on.
|
int[] |
toSystemIds(int aIdLength,
String aSeed) |
Creates an array of IDs most probably unique as specified by the provided
argument this method is invoked on.
|
String |
toSystemSequence() |
Creates a
String most probably unique as specified by the
provided argument this method is invoked on. |
String |
toSystemSequence(String aSeed) |
Creates a
String most probably unique as specified by the
provided argument this method is invoked on. |
static SystemContext |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static SystemContext[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SystemContext APPLICATION
public static final SystemContext USER_APPLICATION
public static final SystemContext HOST_USER_APPLICATION
public static final SystemContext HOST_APPLICATION
public static final SystemContext USER
public static final SystemContext HOST_USER
public static final SystemContext HOST
public static SystemContext[] values()
for (SystemContext c : SystemContext.values()) System.out.println(c);
public static SystemContext 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 boolean isHostLevel()
public boolean isUserLevel()
public boolean isApplicationLevel()
public String toSystemSequence()
String
most probably unique as specified by the
provided argument this method is invoked on. Attention: The result my
vary depending on the user under which the application is being executed!
Supports the environment variable EnvironmentVariable.HOST_SEED
as well as the system property SystemProperty.HOST_SEED
.
The enumeration value specifies the context for the created ID, e.g.
which system properties to take into account.String
.public String toSystemSequence(String aSeed)
String
most probably unique as specified by the
provided argument this method is invoked on. Attention: The result my
vary depending on the user under which the application is being executed!
Supports the environment variable EnvironmentVariable.HOST_SEED
as well as the system property SystemProperty.HOST_SEED
.
The enumeration value specifies the context for the created ID, e.g.
which system properties to take into account.aSeed
- A seed to alter the ID individually.String
.public int toSystemId()
EnvironmentVariable.HOST_SEED
as well as the
system property SystemProperty.HOST_SEED
.
The enumeration value specifies the context for the created ID, e.g.
which system properties to take into account.public int toSystemId(String aSeed)
EnvironmentVariable.HOST_SEED
as well as the system property
SystemProperty.HOST_SEED
.
System.out.println(System.getenv("PROCESSOR_ARCHITECTURE"));
System.out.println(System.getenv("PROCESSOR_ARCHITEW6432"));
System.getProperty("os.arch");
The enumeration value specifies the context for the created ID, e.g.
which system properties to take into account.aSeed
- A seed to alter the ID individually.public int[] toSystemIds(int aIdLength)
EnvironmentVariable.HOST_SEED
as well as the system property
SystemProperty.HOST_SEED
.
The enumeration value specifies the context for the created ID, e.g.
which system properties to take into account.aIdLength
- The number of IDs to be generated.public int[] toSystemIds(int aIdLength, String aSeed)
EnvironmentVariable.HOST_SEED
as well as the system property
SystemProperty.HOST_SEED
.
The enumeration value specifies the context for the created ID, e.g.
which system properties to take into account.aIdLength
- The number of IDs to be generated.aSeed
- A seed to alter the ID individually.Copyright © 2018. All rights reserved.