Package org.apache.sshd.common.random
Class SingletonRandomFactory
java.lang.Object
org.apache.sshd.common.random.AbstractRandom
org.apache.sshd.common.random.SingletonRandomFactory
- All Implemented Interfaces:
Supplier<Random>
,BuiltinFactory<Random>
,Factory<Random>
,NamedFactory<Random>
,NamedResource
,OptionalFeature
,Random
,RandomFactory
A random factory wrapper that uses a single random instance. The underlying random instance has to be thread safe.
-
Field Summary
FieldsFields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Fields inherited from interface org.apache.sshd.common.OptionalFeature
FALSE, TRUE
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.sshd.common.random.AbstractRandom
toString
-
Field Details
-
factory
-
random
-
-
Constructor Details
-
SingletonRandomFactory
-
-
Method Details
-
isSupported
public boolean isSupported()- Specified by:
isSupported
in interfaceOptionalFeature
-
fill
public void fill(byte[] bytes, int start, int len) Description copied from interface:Random
Fill part of bytes with random values. -
random
public int random(int max) Description copied from interface:Random
Returns a pseudo-random uniformly distributedint
in the half-open range [0, n). -
getName
- Specified by:
getName
in interfaceNamedResource
- Returns:
- The resource name
-
create
-