From 365a83d21fe9d07d3c9617efaecc649872ea091c Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Sun, 3 Sep 2023 15:45:43 +0200 Subject: [PATCH] Add CharSequenceRandomizer Resolves #458 --- .../text/CharSequenceRandomizer.java | 38 +++++++++++++++++++ .../randomizers/text/StringRandomizer.java | 3 +- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/jeasy/random/randomizers/text/CharSequenceRandomizer.java diff --git a/src/main/java/org/jeasy/random/randomizers/text/CharSequenceRandomizer.java b/src/main/java/org/jeasy/random/randomizers/text/CharSequenceRandomizer.java new file mode 100644 index 00000000..35436949 --- /dev/null +++ b/src/main/java/org/jeasy/random/randomizers/text/CharSequenceRandomizer.java @@ -0,0 +1,38 @@ +/* + * The MIT License + * + * Copyright (c) 2023, Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.jeasy.random.randomizers.text; + +import org.jeasy.random.randomizers.AbstractRandomizer; + +public abstract class CharSequenceRandomizer extends AbstractRandomizer { + + protected CharSequenceRandomizer() { + super(); + } + + protected CharSequenceRandomizer(long seed) { + super(seed); + } + +} \ No newline at end of file diff --git a/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java b/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java index bbdd0b21..0879545a 100644 --- a/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java +++ b/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java @@ -24,7 +24,6 @@ package org.jeasy.random.randomizers.text; import org.jeasy.random.EasyRandomParameters; -import org.jeasy.random.randomizers.AbstractRandomizer; import java.nio.charset.Charset; @@ -33,7 +32,7 @@ * * @author Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com) */ -public class StringRandomizer extends AbstractRandomizer { +public class StringRandomizer extends CharSequenceRandomizer { private final CharacterRandomizer characterRandomizer;