diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/constant/JobConstants.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/constant/JobConstants.java deleted file mode 100644 index 166a18b5..00000000 --- a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/constant/JobConstants.java +++ /dev/null @@ -1,8 +0,0 @@ -// package org.cardanofoundation.ledgersync.scheduler.constant; - -// public final class JobConstants { -// private JobConstants() {} - -// public static final int DEFAULT_BATCH = 20; -// public static final char END_LINE = '\n'; -// } diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/projection/PoolHashUrlProjection.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/projection/PoolHashUrlProjection.java deleted file mode 100644 index abeee728..00000000 --- a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/projection/PoolHashUrlProjection.java +++ /dev/null @@ -1,9 +0,0 @@ -// package org.cardanofoundation.ledgersync.scheduler.projection; - -// public interface PoolHashUrlProjection { -// Long getPoolId(); - -// String getUrl(); - -// Long getMetadataId(); -// } diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/DataUtil.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/DataUtil.java deleted file mode 100644 index f87fe2e7..00000000 --- a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/DataUtil.java +++ /dev/null @@ -1,100 +0,0 @@ -// package org.cardanofoundation.ledgersync.scheduler.util; - -// import java.text.DecimalFormat; -// import java.text.SimpleDateFormat; -// import java.time.Duration; -// import java.time.Instant; -// import java.time.LocalDateTime; -// import java.time.format.DateTimeFormatter; -// import java.util.Collection; -// import java.util.Date; -// import java.util.Map; - -// public class DataUtil { - -// public static boolean isNullOrEmpty(CharSequence cs) { -// int strLen; -// if (cs == null || (strLen = cs.length()) == 0) { -// return true; -// } -// for (int i = 0; i < strLen; i++) { -// if (!Character.isWhitespace(cs.charAt(i))) { -// return false; -// } -// } -// return true; -// } - -// public static boolean isNullOrEmpty(final Collection collection) { -// return collection == null || collection.isEmpty(); -// } - -// public static boolean isNullOrEmpty(final Object obj) { -// return obj == null || obj.toString().isEmpty(); -// } - -// public static boolean isNullOrEmpty(final Object[] collection) { -// return collection == null || collection.length == 0; -// } - -// public static boolean isNullOrEmpty(final Map map) { -// return map == null || map.isEmpty(); -// } - -// public static String instantToString(Instant value, String pattern) { -// if (pattern != null) { -// DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern); -// return dtf.format(value.plus(Duration.ofHours(7))); -// } -// return ""; -// } - -// public static String localDateTimeToString(LocalDateTime value, String pattern) { -// if (pattern != null) { -// DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern); -// return dtf.format(value.plus(Duration.ofHours(7))); -// } -// return ""; -// } - -// public static String dateToString(Date value, String pattern) { -// if (pattern != null) { -// SimpleDateFormat dtf = new SimpleDateFormat(pattern); -// return dtf.format(Date.from(value.toInstant().plus(Duration.ofHours(7)))); -// } -// return ""; -// } - -// public static String enumToString(Enum value) { -// if (value == null) { -// return ""; -// } -// String text = value.name(); -// text = text.replaceAll("_", " "); -// text = text.toLowerCase(); -// return text.substring(0, 1).toUpperCase() + text.substring(1); -// } - -// public static String objectToString(Object value) { -// return (value == null) ? "" : value.toString(); -// } - -// public static String doubleToString(Double value) { -// if (value == null) { -// return ""; -// } -// DecimalFormat doubleFormat = new DecimalFormat("#.######"); -// String result = doubleFormat.format(value); -// if (result.endsWith(".0")) { -// result = result.split("\\.")[0]; -// } -// return result; -// } - -// public static String makeLikeQuery(String s) { -// if (DataUtil.isNullOrEmpty(s)) { -// return null; -// } -// return "%" + s + "%"; -// } -// } diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/HexUtils.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/HexUtils.java deleted file mode 100644 index 3c7964a4..00000000 --- a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/HexUtils.java +++ /dev/null @@ -1,27 +0,0 @@ -// package org.cardanofoundation.ledgersync.scheduler.util; - - -// public class HexUtils { - -// private HexUtils() { -// throw new IllegalStateException("Utility class"); -// } - -// /** -// * Convert from hex to UTF-8 -// * -// * @param hexString string hex -// * @return string UTF-8 -// */ -// // public static String fromHex(String hexString, String fingerprint) { -// // try { -// // byte[] bytes = Hex.decodeHex(hexString.toCharArray()); -// // if (StringUtil.isUtf8(bytes)) { -// // return new String(bytes, StandardCharsets.UTF_8); -// // } -// // return fingerprint; -// // } catch (Exception ex) { -// // return fingerprint; -// // } -// // } -// } diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/ReflectorUtil.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/ReflectorUtil.java deleted file mode 100644 index 374d1731..00000000 --- a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/ReflectorUtil.java +++ /dev/null @@ -1,46 +0,0 @@ -// package org.cardanofoundation.ledgersync.scheduler.util; - -// import java.lang.reflect.Field; -// import java.util.*; - -// public class ReflectorUtil { -// public static List getAllFields(Class clazz) { -// List> classes = getAllSuperclasses(clazz); -// classes.add(clazz); -// return getAllFields(classes); -// } - -// /** -// * As {@link #getAllFields(Class)} but acts on a list of {@link Class}s and uses only {@link -// * Class#getDeclaredFields()}. -// * -// * @param classes The list of classes to reflect on -// * @return The complete list of fields -// */ -// private static List getAllFields(List> classes) { -// Set fields = new HashSet<>(); -// for (Class clazz : classes) { -// fields.addAll(Arrays.asList(clazz.getDeclaredFields())); -// } - -// return new ArrayList<>(fields); -// } - -// /** -// * Return a List of super-classes for the given class. -// * -// * @param clazz the class to look up -// * @return the List of super-classes in order going up from this one -// */ -// public static List> getAllSuperclasses(Class clazz) { -// List> classes = new ArrayList<>(); - -// Class superclass = clazz.getSuperclass(); -// while (superclass != null) { -// classes.add(superclass); -// superclass = superclass.getSuperclass(); -// } - -// return classes; -// } -// } diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/StreamUtil.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/StreamUtil.java deleted file mode 100644 index 187076ce..00000000 --- a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/StreamUtil.java +++ /dev/null @@ -1,86 +0,0 @@ -// package org.cardanofoundation.ledgersync.scheduler.util; - -// import lombok.experimental.UtilityClass; - -// import java.util.Collection; -// import java.util.List; -// import java.util.Map; -// import java.util.Set; -// import java.util.function.Consumer; -// import java.util.function.Function; -// import java.util.function.Predicate; -// import java.util.stream.Collectors; - -// @UtilityClass -// public class StreamUtil { - -// public static List mapApply(Collection collection, Function function) { -// return collection.stream().map(function).collect(Collectors.toList()); -// } - -// public static Set mapApplySet(Collection collection, Function function) { -// return collection.stream().map(function).collect(Collectors.toSet()); -// } - -// public static List filterApply(Collection collection, Predicate filter) { -// return collection.stream().filter(filter).collect(Collectors.toList()); -// } - -// public static List mapThenFilterApply( -// Collection collection, Function function, Predicate predicate) { -// return collection.stream().map(function).filter(predicate).collect(Collectors.toList()); -// } - -// public static List filterThenMapApply( -// Collection collection, Predicate predicate, Function function) { -// return collection.stream().filter(predicate).map(function).collect(Collectors.toList()); -// } - -// public static Set mapThenFilterApplyToSet( -// Collection collection, Function function, Predicate predicate) { -// return collection.stream().map(function).filter(predicate).collect(Collectors.toSet()); -// } - -// public static Map toMap(Collection collection, Function function) { -// return collection.stream().collect(Collectors.toMap(function, Function.identity())); -// } - -// public static Map toMap( -// Collection collection, Function functionKey, Function functionVal) { -// return collection.stream().collect(Collectors.toMap(functionKey, functionVal)); -// } - -// public static Map filterApplyThenToMap( -// Collection collection, -// Predicate predicate, -// Function functionKey, -// Function functionVal) { -// return collection.stream() -// .filter(predicate) -// .collect(Collectors.toMap(functionKey, functionVal)); -// } - -// public static Map> groupingApply( -// Collection collection, Function function) { -// return collection.stream().collect(Collectors.groupingBy(function)); -// } - -// public static Map> groupingApply( -// Collection collection, Function functionKey, Function functionValue) { -// return collection.stream() -// .collect( -// Collectors.groupingBy( -// functionKey, Collectors.mapping(functionValue, Collectors.toList()))); -// } - -// public static Function of(Function function) { -// return function; -// } - -// public static Function peek(Consumer consumer) { -// return t -> { -// consumer.accept(t); -// return t; -// }; -// } -// } diff --git a/govoffchain-scheduler-app/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplicationTests.java b/govoffchain-scheduler-app/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplicationTests.java index b57af35a..a39be896 100644 --- a/govoffchain-scheduler-app/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplicationTests.java +++ b/govoffchain-scheduler-app/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplicationTests.java @@ -6,8 +6,4 @@ @SpringBootTest class GovOffChainSchedulerAppApplicationTests { -// @Test -// void contextLoads() { -// } - }