4 Commits

Author SHA256 Message Date
Minimons
ca639ea6f6 NoIssue: Better documentation 2025-12-03 10:37:58 +01:00
Minimons
df259029bb NoIssue: Add some String generators 2025-12-03 09:32:21 +01:00
Minimons
5336a84c63 NoIssue: Add RandomValueGeneratorInt 2025-11-26 15:05:09 +01:00
Minimons
588e046f5e NoIssue: Clean-up 2025-11-26 14:53:22 +01:00
3 changed files with 35 additions and 6 deletions

View File

@@ -0,0 +1,21 @@
package com.r35157.libs.random;
/**
* This interface provides a way to generate random integers.
*/
public interface RandomValueGeneratorInt {
/**
* Returns a random integer in the full range (min -2<sup>31</sup>. to max 2<sup>31</sup>-1)
*
* @return a random integer in full range
*/
int getSomeInt();
/**
* Returns a random integer in the range provided by the parameters. Both parameters are included in the range and
* {@code minInclusive} must be less than {@code maxInclusive}.
*
* @return a random integer in the provided range
*/
int getSomeInt(int minInclusive, int maxInclusive);
}

View File

@@ -0,0 +1,14 @@
package com.r35157.libs.random;
import org.jetbrains.annotations.NotNull;
public interface RandomValueGeneratorString {
/**
* Generate a random Alpha Numeric String of exactly the length given as the parameter.
*
* @param length Length of generated String - cannot be negative
* @return A non-null random String of the length given
* @throws IllegalArgumentException If length is negative
*/
@NotNull String getSomeStringAlphaNumericOnly(int length) throws IllegalArgumentException;
}

View File

@@ -1,6 +0,0 @@
package com.r35157.libs.random;
public interface SomeInterface {
String concat(String x, String y);
void divideByZero() throws ArithmeticException;
}