001package co.codewizards.cloudstore.core.dto;
002
003import javax.xml.bind.annotation.XmlRootElement;
004
005import co.codewizards.cloudstore.core.version.Version;
006
007@XmlRootElement
008public class VersionInfoDto {
009
010        private Version localVersion;
011
012        private Version minimumRemoteVersion;
013
014        /**
015         * Gets the version of the system which created this {@code VersionInfoDto}.
016         * <p>
017         * Thus, if the server is asked for its version, this property represents the
018         * server's version.
019         * @return the version of the system being asked for this instance. Should
020         * never be <code>null</code>.
021         */
022        public Version getLocalVersion() {
023                return localVersion;
024        }
025        public void setLocalVersion(Version localVersion) {
026                this.localVersion = localVersion;
027        }
028
029        /**
030         * Gets the minimum version expected from its remote peer by the system which created this {@code VersionInfoDto}.
031         * <p>
032         * Thus, <b>if the server is asked</b> for this instance, this property represents <b>the
033         * client's minimum version</b> required.
034         * <p>
035         * If this {@code VersionInfoDto} was created by the client, this property represents the
036         * server's minimum version expected by the client.
037         * @return the minimum version expected by the asked system from its remote peer. Should
038         * never be <code>null</code>.
039         */
040        public Version getMinimumRemoteVersion() {
041                return minimumRemoteVersion;
042        }
043        public void setMinimumRemoteVersion(Version minimumRemoteVersion) {
044                this.minimumRemoteVersion = minimumRemoteVersion;
045        }
046
047        @Override
048        public String toString() {
049                return getClass().getSimpleName() + '[' + toString_getProperties() + ']';
050        }
051
052        protected String toString_getProperties() {
053                return "localVersion=" + localVersion
054                                + ", minimumRemoteVersion=" + minimumRemoteVersion;
055        }
056}