use of com.google.protobuf.Any in project core-java by SpineEventEngine.
the class DoubleMismatch method unpackActual.
/**
* Obtains actual double value from the passed mismatch.
*
* @throws RuntimeException if the passed instance represent a mismatch of non-double values
*/
public static double unpackActual(ValueMismatch mismatch) {
checkNotNull(mismatch);
final Any actual = mismatch.getActual();
return unpacked(actual);
}
use of com.google.protobuf.Any in project core-java by SpineEventEngine.
the class FloatMismatch method unpackNewValue.
/**
* Obtains new float value from the passed mismatch.
*
* @throws RuntimeException if the passed instance represent a mismatch of non-float values
*/
public static float unpackNewValue(ValueMismatch mismatch) {
checkNotNull(mismatch);
final Any newValue = mismatch.getNewValue();
return unpacked(newValue);
}
use of com.google.protobuf.Any in project core-java by SpineEventEngine.
the class PackingIteratorShould method implement_next.
@Test
public void implement_next() throws Exception {
while (packer.hasNext()) {
final Any packed = packer.next();
assertNotNull(packed);
assertFalse(isDefault(unpack(packed)));
}
}
use of com.google.protobuf.Any in project core-java by SpineEventEngine.
the class AnyPackerShould method return_Any_if_it_is_passed_to_pack.
@Test
public void return_Any_if_it_is_passed_to_pack() {
final Any any = Any.pack(googleMsg);
assertSame(any, AnyPacker.pack(any));
}
use of com.google.protobuf.Any in project core-java by SpineEventEngine.
the class AnyPackerShould method unpack_google_message_from_Any.
@Test
public void unpack_google_message_from_Any() {
final Any any = Any.pack(googleMsg);
final StringValue actual = AnyPacker.unpack(any);
assertEquals(googleMsg, actual);
}
Aggregations