001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2006-2010 Sun Microsystems, Inc.
025 *      Portions Copyright 2015 ForgeRock AS.
026 */
027package org.opends.server.replication.plugin;
028
029import java.util.HashMap;
030import java.util.Set;
031
032
033/**
034 * Used to store historical information.
035 * Contain a map of AttrInfo for each options of a given attribute type.
036 */
037public class AttrHistoricalWithOptions
038{
039  private final HashMap<Set<String>, AttrHistorical> attributesInfo = new HashMap<>();
040
041  /** Creates a new AttrInfoWithOptions. */
042  public AttrHistoricalWithOptions()
043  {
044  }
045
046  /**
047   * Get the info for a given option.
048   *
049   * @param options the options
050   * @return the information
051   */
052  public AttrHistorical get(Set<String> options)
053  {
054    return attributesInfo.get(options);
055  }
056
057  /**
058   * Associate some info to a given set of options.
059   *
060   * @param options the options
061   * @param attrInfo the info to associate
062   * @return the info to associate
063   */
064  public AttrHistorical put(Set<String> options, AttrHistorical attrInfo )
065  {
066    return attributesInfo.put(options, attrInfo);
067  }
068
069  /**
070   * Get the Attributes information associated to this object.
071   * @return the set of informations
072   */
073  public HashMap<Set<String>, AttrHistorical> getAttributesInfo()
074  {
075    return attributesInfo;
076  }
077}
078