java/core/src/main/java/org/bondlib/SpecificTypeObjectBonded.java [42:56]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void serialize(ProtocolWriter protocolWriter, StructBondType<U> asBondType) throws IOException {
        ArgumentHelper.ensureNotNull(protocolWriter, "protocolWriter");
        ArgumentHelper.ensureNotNull(asBondType, "asBondType");
        if (this.bondType.isSubtypeOf(asBondType)) {
            // we can always serialize the base struct type portion by slicing
            @SuppressWarnings("unchecked")
            U castObjectInstance = (U) this.objectInstance;
            asBondType.serialize(castObjectInstance, protocolWriter);
        } else {
            // but we need to transcode in all other cases
            // TODO: complete this implementation after transcoding is implemented
            throw new UnsupportedOperationException(
                    "Serialization as a non-ancestor struct type is not currently implemented.");
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/core/src/main/java/org/bondlib/WildcardTypeObjectBonded.java [50:64]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void serialize(ProtocolWriter protocolWriter, StructBondType<U> asBondType) throws IOException {
        ArgumentHelper.ensureNotNull(protocolWriter, "protocolWriter");
        ArgumentHelper.ensureNotNull(asBondType, "asBondType");
        if (this.bondType.isSubtypeOf(asBondType)) {
            // we can always serialize the base struct type portion by slicing
            @SuppressWarnings("unchecked")
            U castObjectInstance = (U) this.objectInstance;
            asBondType.serialize(castObjectInstance, protocolWriter);
        } else {
            // but we need to transcode in all other cases
            // TODO: complete this implementation after transcoding is implemented
            throw new UnsupportedOperationException(
                    "Serialization as a non-ancestor struct type is not currently implemented.");
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



