Skip to content

Commit

Permalink
add workaround for ByteString values, to avoid exception in SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
tbischoff2 committed Oct 25, 2024
1 parent fe90790 commit 38e04ff
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
import de.fraunhofer.iosb.ilt.faaast.service.model.value.TypedValueFactory;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.mapper.ElementValueMapper;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.AbstractDateTimeValue;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.Base64BinaryValue;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.DateTimeValue;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.DecimalValue;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.DurationValue;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.HexBinaryValue;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.IntegerValue;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.NegativeIntegerValue;
import de.fraunhofer.iosb.ilt.faaast.service.model.value.primitive.NonNegativeIntegerValue;
Expand Down Expand Up @@ -790,6 +792,12 @@ else if (typedValue instanceof DateTimeValue dateTimeValue) {
else if (typedValue instanceof AbstractDateTimeValue<?> sbstractDateTimeValue) {
retval = sbstractDateTimeValue.asString();
}
else if (typedValue instanceof HexBinaryValue hexBinaryValue) {
retval = ByteString.valueOf(hexBinaryValue.getValue());
}
else if (typedValue instanceof Base64BinaryValue base64BinaryValue) {
retval = ByteString.valueOf(base64BinaryValue.getValue());
}
return retval;
}

Expand Down

0 comments on commit 38e04ff

Please sign in to comment.