Skip to content

Commit 30e1a01

Browse files
committed
Merge branch 'release/2.2.4'
2 parents 80fae8a + 658b582 commit 30e1a01

File tree

6 files changed

+26
-3
lines changed

6 files changed

+26
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.riscure</groupId>
88
<artifactId>trsfile</artifactId>
9-
<version>2.2.3</version>
9+
<version>2.2.4</version>
1010
<packaging>jar</packaging>
1111

1212
<name>${project.groupId}:${project.artifactId}</name>

src/main/java/com/riscure/trs/Trace.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
* including potential associated data and a title
1212
*/
1313
public class Trace {
14+
private static final String TO_STRING_FORMAT = "Trace{Title='%s', numberOfSamples=%d, shifted=%d, " +
15+
"aggregatesValid=%b, hasIllegalValues=%b, isReal=%b, max=%f, min=%f%n%s}";
16+
1417
/**
1518
* Factory method. This will copy the sample array for stability.
1619
* @param sample the sample array
@@ -194,6 +197,12 @@ public void setTraceSet(TraceSet traceSet) {
194197
this.traceSet = traceSet;
195198
}
196199

200+
@Override
201+
public String toString() {
202+
return String.format(TO_STRING_FORMAT, title, sample.array().length, shifted,
203+
aggregatesValid, hasIllegalValues, isReal, max, min, parameters);
204+
}
205+
197206
/** A map of all custom named trace parameters */
198207
private TraceParameterMap parameters = new TraceParameterMap();
199208
/** list of samples */

src/main/java/com/riscure/trs/parameter/trace/TraceParameterMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import java.util.Optional;
1717

1818
public class TraceParameterMap extends LinkedHashMap<String, TraceParameter> {
19-
private static final String KEY_NOT_FOUND = "Parameter %s was not found in the trace set.";
19+
private static final String KEY_NOT_FOUND = "TraceParameter %s was not found in the trace.";
2020
private static final String EMPTY_DATA_BUT_NONEMPTY_DEFINITIONS = "The provided byte array is null or empty, but the provided definitions are not";
2121
private static final String DATA_LENGTH_DEFINITIONS_MISMATCH = "The provided byte array (%d bytes) does not match the total definitions length (%d bytes)";
2222

src/main/java/com/riscure/trs/parameter/trace/definition/TraceParameterDefinition.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.riscure.trs.parameter.TraceParameter;
77

88
import java.io.IOException;
9+
import java.util.stream.Collectors;
910

1011
public class TraceParameterDefinition<T extends TraceParameter> {
1112
private final ParameterType type;
@@ -68,4 +69,9 @@ public int hashCode() {
6869
result = 31 * result + (int) length;
6970
return result;
7071
}
72+
73+
@Override
74+
public String toString() {
75+
return String.format("TraceParameterDefinition{Type=%s, Offset=%d, Length=%d}", getType(), getOffset(), getLength());
76+
}
7177
}

src/main/java/com/riscure/trs/parameter/traceset/TraceSetParameterMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* This explicitly implements LinkedHashMap to ensure that the data is retrieved in the same order as it was added
2121
*/
2222
public class TraceSetParameterMap extends LinkedHashMap<String, TraceSetParameter> {
23-
private static final String KEY_NOT_FOUND = "Parameter %s was not found in the trace set.";
23+
private static final String KEY_NOT_FOUND = "TraceSetParameter %s was not found in the trace set.";
2424

2525
public TraceSetParameterMap() {
2626
super();

src/main/java/com/riscure/trs/types/TypedKey.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,12 @@ public int hashCode() {
6161
result = 31 * result + (key != null ? key.hashCode() : 0);
6262
return result;
6363
}
64+
65+
@Override
66+
public String toString() {
67+
return "TypedKey{" +
68+
"key='" + key +
69+
"', cls=" + cls +
70+
'}';
71+
}
6472
}

0 commit comments

Comments
 (0)