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

IcePatch2.LargeFileInfo Maven / Gradle / Ivy

There is a newer version: 3.7.10
Show newest version
// **********************************************************************
//
// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.6.4
//
// 
//
// Generated from file `FileInfo.ice'
//
// Warning: do not edit this file.
//
// 
//

package IcePatch2;

/**
 * Basic information about a single file.
 *
 **/
public class LargeFileInfo implements java.lang.Cloneable, java.io.Serializable
{
    /**
     * The pathname.
     **/
    public String path;

    /**
     * The SHA-1 checksum of the file.
     **/
    public byte[] checksum;

    /**
     * The size of the compressed file in number of bytes.
     **/
    public long size;

    /**
     * The executable flag.
     **/
    public boolean executable;

    public LargeFileInfo()
    {
        path = "";
    }

    public LargeFileInfo(String path, byte[] checksum, long size, boolean executable)
    {
        this.path = path;
        this.checksum = checksum;
        this.size = size;
        this.executable = executable;
    }

    public boolean
    equals(java.lang.Object rhs)
    {
        if(this == rhs)
        {
            return true;
        }
        LargeFileInfo _r = null;
        if(rhs instanceof LargeFileInfo)
        {
            _r = (LargeFileInfo)rhs;
        }

        if(_r != null)
        {
            if(path != _r.path)
            {
                if(path == null || _r.path == null || !path.equals(_r.path))
                {
                    return false;
                }
            }
            if(!java.util.Arrays.equals(checksum, _r.checksum))
            {
                return false;
            }
            if(size != _r.size)
            {
                return false;
            }
            if(executable != _r.executable)
            {
                return false;
            }

            return true;
        }

        return false;
    }

    public int
    hashCode()
    {
        int __h = 5381;
        __h = IceInternal.HashUtil.hashAdd(__h, "::IcePatch2::LargeFileInfo");
        __h = IceInternal.HashUtil.hashAdd(__h, path);
        __h = IceInternal.HashUtil.hashAdd(__h, checksum);
        __h = IceInternal.HashUtil.hashAdd(__h, size);
        __h = IceInternal.HashUtil.hashAdd(__h, executable);
        return __h;
    }

    public LargeFileInfo
    clone()
    {
        LargeFileInfo c = null;
        try
        {
            c = (LargeFileInfo)super.clone();
        }
        catch(CloneNotSupportedException ex)
        {
            assert false; // impossible
        }
        return c;
    }

    public void
    __write(IceInternal.BasicStream __os)
    {
        __os.writeString(path);
        Ice.ByteSeqHelper.write(__os, checksum);
        __os.writeLong(size);
        __os.writeBool(executable);
    }

    public void
    __read(IceInternal.BasicStream __is)
    {
        path = __is.readString();
        checksum = Ice.ByteSeqHelper.read(__is);
        size = __is.readLong();
        executable = __is.readBool();
    }

    static public void
    __write(IceInternal.BasicStream __os, LargeFileInfo __v)
    {
        if(__v == null)
        {
            __nullMarshalValue.__write(__os);
        }
        else
        {
            __v.__write(__os);
        }
    }

    static public LargeFileInfo
    __read(IceInternal.BasicStream __is, LargeFileInfo __v)
    {
        if(__v == null)
        {
             __v = new LargeFileInfo();
        }
        __v.__read(__is);
        return __v;
    }
    
    private static final LargeFileInfo __nullMarshalValue = new LargeFileInfo();

    public static final long serialVersionUID = 1105566963219174392L;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy