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

com.sun.xml.ws.transport.tcp.util.Version Maven / Gradle / Ivy

/*
 * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0, which is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package com.sun.xml.ws.transport.tcp.util;

/**
 * @author Alexey Stashok
 */
public final class Version {
    private final int major;
    private final int minor;
    
    public Version(int major, int minor) {
        this.major = major;
        this.minor = minor;
    }
    
    public int getMajor() {
        return major;
    }
    
    public int getMinor() {
        return minor;
    }

    public boolean equals(final Object object) {
        if (object instanceof Version) {
            final Version version = (Version) object;
            return major == version.major && minor == version.minor;
        }
        
        return false;
    }
    
    public int hashCode() {
        return (major << 16) | minor;
    }
    
    public String toString() {
        return major + "." + minor;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy