Skip to content

Commit 9cd239b

Browse files
Removing now obsolete import
1 parent dd6b111 commit 9cd239b

File tree

4 files changed

+59
-6
lines changed

4 files changed

+59
-6
lines changed

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ dependencies {
9696
implementation 'commons-io:commons-io:2.15.1' // I/O functionalities
9797
implementation 'commons-codec:commons-codec:1.16.1' // needed by commons-compress
9898
implementation 'org.apache.commons:commons-compress:1.26.0' // I/O functionalities
99-
implementation 'org.apache.commons:commons-lang3:3.14.0'
10099
}
101100

102101
tasks.withType(JavaCompile) {

src/main/java/edu/ie3/datamodel/io/source/EntitySource.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,21 @@
1515
import edu.ie3.datamodel.io.factory.input.NodeAssetInputEntityData;
1616
import edu.ie3.datamodel.models.Entity;
1717
import edu.ie3.datamodel.models.UniqueEntity;
18-
import edu.ie3.datamodel.models.input.*;
18+
import edu.ie3.datamodel.models.input.AssetInput;
19+
import edu.ie3.datamodel.models.input.NodeInput;
20+
import edu.ie3.datamodel.models.input.OperatorInput;
21+
import edu.ie3.datamodel.utils.TriFunction;
1922
import edu.ie3.datamodel.utils.Try;
20-
import edu.ie3.datamodel.utils.Try.*;
21-
import java.util.*;
23+
import edu.ie3.datamodel.utils.Try.Failure;
24+
import edu.ie3.datamodel.utils.Try.Success;
25+
import java.util.Map;
26+
import java.util.Optional;
27+
import java.util.Set;
28+
import java.util.UUID;
2229
import java.util.function.BiFunction;
2330
import java.util.function.Function;
2431
import java.util.stream.Collectors;
2532
import java.util.stream.Stream;
26-
import org.apache.commons.lang3.function.TriFunction;
2733
import org.slf4j.Logger;
2834
import org.slf4j.LoggerFactory;
2935

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* © 2024. TU Dortmund University,
3+
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
4+
* Research group Distribution grid planning and operation
5+
*/
6+
package edu.ie3.datamodel.utils;
7+
8+
import java.util.Objects;
9+
import java.util.function.Function;
10+
11+
/**
12+
* Enhancement of {@link Function} and {@link java.util.function.BiFunction} that accepts three
13+
* arguments and produces a result.
14+
*
15+
* @param <A> the type of the first argument to the function
16+
* @param <B> the type of the second argument to the function
17+
* @param <C> the type of the third argument to the function
18+
* @param <R> the type of the result of the function
19+
*/
20+
@FunctionalInterface
21+
public interface TriFunction<A, B, C, R> {
22+
23+
/**
24+
* Applies this function to the given arguments.
25+
*
26+
* @param a the first function argument
27+
* @param b the second function argument
28+
* @param c the third function argument
29+
* @return the function result
30+
*/
31+
R apply(A a, B b, C c);
32+
33+
/**
34+
* Returns a composed function that first applies this function to its input, and then applies the
35+
* {@code after} function to the result. If evaluation of either function throws an exception, it
36+
* is relayed to the caller of the composed function.
37+
*
38+
* @param <V> the type of output of the {@code after} function, and of the composed function
39+
* @param after the function to apply after this function is applied
40+
* @return a composed function that first applies this function and then applies the {@code after}
41+
* function
42+
* @throws NullPointerException if after is null
43+
*/
44+
default <V> TriFunction<A, B, C, V> andThen(Function<? super R, ? extends V> after) {
45+
Objects.requireNonNull(after);
46+
return (final A a, final B b, final C c) -> after.apply(apply(a, b, c));
47+
}
48+
}

src/test/groovy/edu/ie3/datamodel/io/factory/input/AssetInputEntityFactoryTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
package edu.ie3.datamodel.io.factory.input
77

88
import edu.ie3.datamodel.exceptions.FactoryException
9+
import edu.ie3.datamodel.exceptions.NotImplementedException
910
import edu.ie3.datamodel.models.OperationTime
1011
import edu.ie3.datamodel.models.input.AssetInput
1112
import edu.ie3.datamodel.models.input.OperatorInput
1213
import edu.ie3.datamodel.utils.Try
1314
import edu.ie3.test.helper.FactoryTestHelper
14-
import org.apache.commons.lang3.NotImplementedException
1515
import spock.lang.Specification
1616

1717
import java.time.ZonedDateTime

0 commit comments

Comments
 (0)