IndexTypeDescriptor.java revision 8196da2152209c8c628611aeeb4adae32079921e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2015 ForgeRock AS
*/
/**
* Defines the set of values for the index type and provides adaptors to convert
*/
public enum IndexTypeDescriptor
{
/**
* This index type is used to improve the efficiency of searches using
* approximate matching search filters.
*/
/**
* This index type is used to improve the efficiency of searches using
* equality search filters.
*/
/**
* This index type is used to improve the efficiency of searches using
* extensible matching search filters.
*/
/**
* This index type is used to improve the efficiency of searches using
* "greater than or equal to" or "less then or equal to" search filters.
*/
/**
* This index type is used to improve the efficiency of searches using the
* presence search filters.
*/
/**
* This index type is used to improve the efficiency of searches using
* substring search filters.
*/
private final org.forgerock.opendj.server.config.meta.BackendIndexCfgDefn.IndexType backendIndexType;
{
this.backendIndexType = backendIndexType;
}
/**
* Convert the index type to the equivalent
* {@code BackendIndexCfgDefn.IndexType}.
*
* @return The index type to the equivalent
* {@code BackendIndexCfgDefn.IndexType}
*/
{
return oldConfigBackendIndexType;
}
private static IndexTypeDescriptor fromBackendIndexType(final BackendIndexCfgDefn.IndexType indexType)
{
switch (indexType)
{
case APPROXIMATE:
return APPROXIMATE;
case EQUALITY:
return EQUALITY;
case EXTENSIBLE:
return EXTENSIBLE;
case ORDERING:
return ORDERING;
case PRESENCE:
return PRESENCE;
case SUBSTRING:
return SUBSTRING;
default:
}
}
/**
* Convert the provided {@code Set<BackendIndexCfgDefn.IndexType>} to a
* {@code Set<IndexTypeDescriptor>}.
*
* @param indexTypes
* A set of {@code Set<BackendIndexCfgDefn.IndexType>}
* @return A set of {@code Set<IndexTypeDescriptor>} corresponding to the
* provided {@code Set<BackendIndexCfgDefn.IndexType>}
*/
public static Set<IndexTypeDescriptor> fromBackendIndexTypes(final Set<BackendIndexCfgDefn.IndexType> indexTypes)
{
{
}
return indexTypeDescriptors;
}
/**
* Convert the provided {@code Set<IndexTypeDescriptor>} to a
* {@code Set<BackendIndexCfgDefn.IndexType>}.
*
* @param indexTypeDescriptors
* A set of {@code Set<IndexTypeDescriptor>}
* @return A set of {@code Set<BackendIndexCfgDefn.IndexType>} corresponding
* to the provided {@code Set<IndexTypeDescriptor>}
*/
{
{
}
return indexTypes;
}
/**
* Convert the provided {@code Set<IndexTypeDescriptor>} to a
* {@code Set<org.forgerock.opendj.server.config.meta.BackendIndexCfgDefn.IndexType>}.
*
* @param indexTypeDescriptors
* A set of {@code Set<IndexTypeDescriptor>}
* @return A set of
* {@code Set<org.forgerock.opendj.server.config.meta.BackendIndexCfgDefn.IndexType>}
* corresponding to the provided {@code Set<IndexTypeDescriptor>}
*/
public static Set<org.forgerock.opendj.server.config.meta.BackendIndexCfgDefn.IndexType> toNewConfigBackendIndexTypes(
{
Set<org.forgerock.opendj.server.config.meta.BackendIndexCfgDefn.IndexType> newConfigIndexTypes = new HashSet<>();
{
}
return newConfigIndexTypes;
}
}