All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nakedobjects.nos.remote.command.java.JavaClientResult Maven / Gradle / Ivy

There is a newer version: 3.0.3
Show newest version
package org.nakedobjects.nos.remote.command.java;

import java.io.Serializable;

import org.nakedobjects.noa.adapter.Version;
import org.nakedobjects.noa.util.ByteDecoder;
import org.nakedobjects.noa.util.ByteEncoder;
import org.nakedobjects.noa.util.Encodable;
import org.nakedobjects.nof.reflect.remote.data.ClientActionResultData;
import org.nakedobjects.nof.reflect.remote.data.ObjectData;
import org.nakedobjects.nof.reflect.remote.data.ReferenceData;


public class JavaClientResult implements ClientActionResultData, Encodable, Serializable {
    private static final long serialVersionUID = 1L;
    private final ReferenceData[] madePersistent;
    private final Version[] changedVersion;
    private final ObjectData[] updates;

    JavaClientResult(final ReferenceData[] madePersistent, final Version[] changedVersion, final ObjectData[] updates) {
        this.madePersistent = madePersistent;
        this.changedVersion = changedVersion;
        this.updates = updates;
    }

    public JavaClientResult(final ByteDecoder decoder) {
        changedVersion = (Version[]) decoder.getObjects();
        madePersistent = (ObjectData[]) decoder.getObjects();
        updates = (ObjectData[]) decoder.getObjects();
    }

    public void encode(final ByteEncoder encoder) {
        encoder.add(changedVersion);
        encoder.add(madePersistent);
        encoder.add(updates);
    }

    public ReferenceData[] getPersisted() {
        return madePersistent;
    }

    public Version[] getChanged() {
        return changedVersion;
    }

    public ObjectData[] getUpdates() {
        return updates;
    }
}
// Copyright (c) Naked Objects Group Ltd.




© 2015 - 2025 Weber Informatics LLC | Privacy Policy