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_EXTRACTORFields 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:
isSupportedin interfaceOptionalFeature
-
fill
public void fill(byte[] bytes, int start, int len) Description copied from interface:RandomFill part of bytes with random values. -
random
public int random(int max) Description copied from interface:RandomReturns a pseudo-random uniformly distributedintin the half-open range [0, n). -
getName
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-
create
-