package org.apache.commons.jcs3.auxiliary.lateral;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import java.io.Serializable;

import org.apache.commons.jcs3.engine.behavior.ICacheElement;

/**
 * This class wraps command to other laterals. It is essentially a
 * JCS-TCP-Lateral packet. The headers specify the action the receiver should
 * take.
 */
public class LateralElementDescriptor<K, V>
    implements Serializable
{
    /** Don't change */
    private static final long serialVersionUID = 5268222498076063575L;

    /** The Cache Element that we are distributing. */
    public ICacheElement<K, V> ce;

    /**
     * The id of the the source of the request. This is used to prevent infinite
     * loops.
     */
    public long requesterId;

    /** The operation has been requested by the client. */
    public LateralCommand command = LateralCommand.UPDATE;

    /**
     * The hashcode value for this element.
     */
    public int valHashCode = -1;

    /** Constructor for the LateralElementDescriptor object */
    public LateralElementDescriptor()
    {
    }

    /**
     * Constructor for the LateralElementDescriptor object
     * <p>
     * @param ce ICacheElement&lt;K, V&gt; payload
     */
    public LateralElementDescriptor( final ICacheElement<K, V> ce )
    {
        this.ce = ce;
    }

    /**
     * @return String, all the important values that can be configured
     */
    @Override
    public String toString()
    {
        final StringBuilder buf = new StringBuilder();
        buf.append( "\n LateralElementDescriptor " );
        buf.append( "\n command = [" + this.command + "]" );
        buf.append( "\n valHashCode = [" + this.valHashCode + "]" );
        buf.append( "\n ICacheElement = [" + this.ce + "]" );
        return buf.toString();
    }
}

@@ -1783,24 +1783,52 @@
 r object */%0A
+    @Deprecated // Not used%0A
     public L
@@ -2098,32 +2098,1438 @@
 ce = ce;%0A    %7D%0A%0A
+    /**%0A     * Constructor for the LateralElementDescriptor object%0A     * %3Cp%3E%0A     * @param ce ICacheElement&lt;K, V&gt; payload%0A     * @param command operation requested by the client%0A     */%0A    public LateralElementDescriptor( final ICacheElement%3CK, V%3E ce, LateralCommand command)%0A    %7B%0A        this(ce);%0A        this.command = command;%0A    %7D%0A%0A    /**%0A     * Constructor for the LateralElementDescriptor object%0A     * %3Cp%3E%0A     * @param ce ICacheElement&lt;K, V&gt; payload%0A     * @param command operation requested by the client%0A     * @param requesterId id of the the source of the request%0A     */%0A    public LateralElementDescriptor( final ICacheElement%3CK, V%3E ce, LateralCommand command, long requesterId)%0A    %7B%0A        this(ce, command);%0A        this.requesterId = requesterId;%0A    %7D%0A%0A    /**%0A     * Return payload%0A     *%0A     * @return the ce%0A     */%0A    public ICacheElement%3CK, V%3E getPayload()%0A    %7B%0A        return ce;%0A    %7D%0A%0A    /**%0A     * Return id of the the source of the request%0A     *%0A     * @return the requesterId%0A     */%0A    public long getRequesterId()%0A    %7B%0A        return requesterId;%0A    %7D%0A%0A    /**%0A     * Return operation requested by the client%0A     *%0A     * @return the command%0A     */%0A    public LateralCommand getCommand()%0A    %7B%0A        return command;%0A    %7D%0A%0A    /**%0A     * @return the valHashCode%0A     */%0A    public int getValHashCode()%0A    %7B%0A        return valHashCode;%0A    %7D%0A%0A
     /**%0A     * @

Prepare for immutable object