diff --git a/src/main/java/net/andreinc/mockneat/interfaces/MockUnit.java b/src/main/java/net/andreinc/mockneat/interfaces/MockUnit.java index 8da6a03..ef45de2 100644 --- a/src/main/java/net/andreinc/mockneat/interfaces/MockUnit.java +++ b/src/main/java/net/andreinc/mockneat/interfaces/MockUnit.java @@ -47,11 +47,6 @@ public interface MockUnit { // Functional Method Supplier supplier(); - /** - * It's a 'closing' method that returns an arbitrary value of type 'T'. - * - * @return the exact value mocked by the MockUnit . The value is of type . - */ default T val() { return supplier().get(); } @@ -62,13 +57,6 @@ default T valOrElse(T alternateVal) { return result; } - /** - * Serialize an arbitary object generated by the MockUnit to the disk. - * T should implement Serializable. - * - * @param strPath The path where the file is written to disk. - * - */ // TODO Document default void serialize(String strPath) { T object = supplier().get(); @@ -80,47 +68,20 @@ default void serialize(String strPath) { catch (FileNotFoundException e) { throw new UncheckedIOException(e); } } - /** - * It's a closing method that returns an arbitray value of type - * - * @param function The function that is applied to the final value before being returned. - * @param The Returning type of the the applied Function. - * @return - */ default R val(Function function) { notNull(function, "function"); return function.apply(supplier().get()); } - /** - * Consumes the returning value (of type ). - * So instead of returning the arbitrary value generated by the MockUnit, - * this is getting consumed. - * - * @param consumer The consumer method. - */ default void consume(Consumer consumer) { notNull(consumer, "consumer"); consumer.accept(val()); } - /** - * Returns the toString() representation of the arbitrary data generated by the MockUnit. - * If the generated value is NULL, the default "" - empty string is generated. - * - * @return the toString() representation value of the data generated by the MockUnit. - */ default String valStr() { return valStr(""); } - /** - * Retuns the toString() representation of the arbitrary genrated by the MockUnit. - * If the generated value is NULL it's replaced with a default String value. - * - * @param valueIfNull The default value that is returned if the generated value is null. - * @return the toString() representation value of the data generated by the MockUnit. - */ default String valStr(String valueIfNull) { Object val = supplier().get(); if (null == val) { @@ -129,13 +90,6 @@ default String valStr(String valueIfNull) { return val.toString(); } - /** - * This method is used to transform the existing MockUnit mock unit into - * an MockUnit through the function received as parameter (Function). - * - * @param function The transforming function. - * @return - */ default MockUnit map(Function function) { notNull(function, "function"); Supplier supp = () -> function.apply(supplier().get());