Skip to content

Commit

Permalink
Refactor unifying all utils as an abstract class (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
seongahjo authored Nov 2, 2023
1 parent dd3e282 commit a95ff18
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.navercorp.fixturemonkey.api.lazy.LazyArbitrary;

@API(since = "0.6.9", status = Status.EXPERIMENTAL)
public final class ArbitraryUtils {
public abstract class ArbitraryUtils {
public static <T> CombinableArbitrary<T> toCombinableArbitrary(Arbitrary<T> arbitrary) {
return CombinableArbitrary.from(LazyArbitrary.lazy(
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
@API(since = "0.4.0", status = Status.MAINTAINED)
@SuppressFBWarnings("DMI_RANDOM_USED_ONLY_ONCE")
public final class Randoms {
public abstract class Randoms {
private static final boolean USE_JQWIK_ENGINE;
private static final ThreadLocal<Random> CURRENT = new ThreadLocal<>();
private static final ThreadLocal<Long> SEED = new ThreadLocal<>();
Expand All @@ -49,9 +49,6 @@ public final class Randoms {
USE_JQWIK_ENGINE = useJqwikEngine;
}

private Randoms() {
}

public static Random create(String seed) {
if (USE_JQWIK_ENGINE) {
SEED.set(Long.parseLong(seed));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.apiguardian.api.API.Status;

@API(since = "0.6.10", status = Status.EXPERIMENTAL)
public final class AnnotatedTypes {
public abstract class AnnotatedTypes {
public static AnnotatedArrayType from(
AnnotatedType annotatedGenericComponentType,
Type type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import javax.annotation.Nullable;

public final class Reflections {
public abstract class Reflections {

public static <T> T newInstance(Class<T> clazz) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import com.navercorp.fixturemonkey.api.container.ConcurrentLruCache;

@API(since = "0.4.0", status = Status.MAINTAINED)
public final class TypeCache {
public abstract class TypeCache {
private static final Logger LOGGER = LoggerFactory.getLogger(TypeCache.class);
private static final Map<Field, AnnotatedType> FIELD_ANNOTATED_TYPE_MAP = new ConcurrentHashMap<>(2048);
private static final Map<PropertyDescriptor, AnnotatedType> PROPERTY_DESCRIPTOR_ANNOTATED_TYPE_MAP =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import org.apiguardian.api.API.Status;

@API(since = "0.4.0", status = Status.MAINTAINED)
public class Types {
public abstract class Types {
private static final Map<Class<?>, Class<?>> primitiveWrapperMap = new HashMap<>();

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apiguardian.api.API.Status;

@API(since = "0.6.10", status = Status.EXPERIMENTAL)
public final class AnnotatedTypes {
public abstract class AnnotatedTypes {
public static AnnotatedArrayType from(
AnnotatedType annotatedGenericComponentType,
Type type,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.navercorp.fixturemonkey.util;

public final class StringUtils {
private StringUtils() {
}

public abstract class StringUtils {
public static boolean isBlank(String str) {
return str == null || str.trim().isEmpty();
}
Expand Down

0 comments on commit a95ff18

Please sign in to comment.