blob: 2c93d267306181d1e4aa65cd45cf15ea0a4a0467 [file] [log] [blame]
/*
* 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.
*
*/
package org.apache.directory.server.core.changelog;
/**
* A tag on a revision representing a snapshot of the directory server's
* state.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
public class Tag
{
/*
* TODO should we have date in which tag was taken
* TODO should we have the date of the revision that was tagged
*/
private final long revision;
private final String description;
public Tag( long revision, String description )
{
this.revision = revision;
this.description = description;
}
/**
* @return the revision
*/
public long getRevision()
{
return revision;
}
/**
* @return the description
*/
public String getDescription()
{
return description;
}
public boolean equals( Object other )
{
if ( other instanceof Tag )
{
Tag ot = ( Tag ) other;
if ( description != null && ot.getDescription() != null )
{
return revision == ot.getRevision() && description.equals( ot.getDescription() );
}
else if ( description == null && ot.getDescription() == null )
{
return revision == ot.getRevision();
}
}
return false;
}
}