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 010 * docs/licenses/cddl.txt 011 * or http://www.opensource.org/licenses/cddl1.php. 012 * See the License for the specific language governing permissions 013 * and limitations under the License. 014 * 015 * When distributing Covered Code, include this CDDL HEADER in each 016 * file and include the License file at 017 * docs/licenses/cddl.txt. If applicable, 018 * add the following below this CDDL HEADER, with the fields enclosed 019 * by brackets "[]" replaced with your own identifying information: 020 * Portions Copyright [yyyy] [name of copyright owner] 021 * 022 * CDDL HEADER END 023 * 024 * 025 * Copyright 2010-2021 Ping Identity Corporation 026 */ 027package com.unboundid.directory.sdk.common.schema; 028 029 030 031import java.util.List; 032import java.util.Map; 033 034import com.unboundid.ldap.sdk.schema.AttributeUsage; 035import com.unboundid.util.NotExtensible; 036import com.unboundid.util.ThreadSafety; 037import com.unboundid.util.ThreadSafetyLevel; 038 039 040 041/** 042 * This interface defines a set of methods that may be used to obtain 043 * information about an attribute type defined in the server schema. 044 */ 045@NotExtensible() 046@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE) 047public interface AttributeType 048{ 049 /** 050 * Retrieves the numeric OID for this attribute type. 051 * 052 * @return The numeric OID for this attribute type. 053 */ 054 String getOID(); 055 056 057 058 /** 059 * Retrieves the list of names for this attribute type, if any. 060 * 061 * @return The list of names for this attribute type, or an empty list if 062 * there are no user-defined names. 063 */ 064 List<String> getNames(); 065 066 067 068 /** 069 * Retrieves the primary name for this attribute type, or the numeric OID if 070 * no names are defined. 071 * 072 * @return The primary name or OID for this attribute type. 073 */ 074 String getNameOrOID(); 075 076 077 078 /** 079 * Indicates whether the provided string is equal to the OID or any of the 080 * defined names for this attribute type. 081 * 082 * @param name The name for which to make the determination. 083 * 084 * @return {@code true} if the provided string matches the OID or one of the 085 * names for this attribute type, or {@code false} if not. 086 */ 087 boolean hasNameOrOID(final String name); 088 089 090 091 /** 092 * Retrieves the description for this attribute type, if any. 093 * 094 * @return The description for this attribute type, or {@code null} if it 095 * does not have a description. 096 */ 097 String getDescription(); 098 099 100 101 /** 102 * Retrieves the superior type for this attribute type, if any. 103 * 104 * @return The superior type for this attribute type, or {@code null} if this 105 * attribute type does not have a superior type. 106 */ 107 AttributeType getSuperiorType(); 108 109 110 111 /** 112 * Retrieves the attribute syntax for this attribute type. 113 * 114 * @return The attribute syntax for this attribute type. 115 */ 116 AttributeSyntax getSyntax(); 117 118 119 120 /** 121 * Retrieves the equality matching rule for this attribute type, if any. 122 * 123 * @return The equality matching rule for this attribute type, or 124 * {@code null} if there is no equality matching rule for this 125 * attribute type. 126 */ 127 EqualityMatchingRule getEqualityMatchingRule(); 128 129 130 131 /** 132 * Retrieves the ordering matching rule for this attribute type, if any. 133 * 134 * @return The ordering matching rule for this attribute type, or 135 * {@code null} if there is no ordering matching rule for this 136 * attribute type. 137 */ 138 OrderingMatchingRule getOrderingMatchingRule(); 139 140 141 142 /** 143 * Retrieves the substring matching rule for this attribute type, if any. 144 * 145 * @return The substring matching rule for this attribute type, or 146 * {@code null} if there is no substring matching rule for this 147 * attribute type. 148 */ 149 SubstringMatchingRule getSubstringMatchingRule(); 150 151 152 153 /** 154 * Retrieves the approximate matching rule for this attribute type, if any. 155 * 156 * @return The approximate matching rule for this attribute type, or 157 * {@code null} if there is no approximate matching rule for this 158 * attribute type. 159 */ 160 ApproximateMatchingRule getApproximateMatchingRule(); 161 162 163 164 /** 165 * Retrieves the usage for this attribute type. 166 * 167 * @return The usage for this attribute type. 168 */ 169 AttributeUsage getUsage(); 170 171 172 173 /** 174 * Indicates whether this attribute type has an operational usage. 175 * 176 * @return {@code true} if this attribute type has an operational usage, or 177 * {@code false} if not. 178 */ 179 boolean isOperational(); 180 181 182 183 /** 184 * Indicates whether this attribute type is declared single-valued in the 185 * server schema. 186 * 187 * @return {@code true} if this attribute type is declared single-valued in 188 * the server schema, or {@code false} if not. 189 */ 190 boolean isSingleValued(); 191 192 193 194 /** 195 * Indicates whether this attribute type is declared collective in the server 196 * schema. 197 * 198 * @return {@code true} if this attribute type is declared collective in the 199 * server schema, or {@code false} if not. 200 */ 201 boolean isCollective(); 202 203 204 205 /** 206 * Indicates whether this attribute type is declared obsolete in the server 207 * schema. 208 * 209 * @return {@code true} if this attribute type is declared obsolete in the 210 * server schema, or {@code false} if not. 211 */ 212 boolean isObsolete(); 213 214 215 216 /** 217 * Indicates whether this attribute type is declared NO-USER-MODIFICATION in 218 * the server schema. 219 * 220 * @return {@code true} if this attribute type is declared 221 * NO-USER-MODIFICATION in the server schema, or {@code false} if 222 * not. 223 */ 224 boolean isNoUserModification(); 225 226 227 228 /** 229 * Retrieves a map of all defined extensions for this attribute type. 230 * 231 * @return A map of all defined extensions for this attribute type. 232 */ 233 Map<String,List<String>> getExtensions(); 234 235 236 237 /** 238 * Retrieves the name of the schema file in which this attribute type is 239 * defined. 240 * 241 * @return The name of the schema file in which this attribute type is 242 * defined. 243 */ 244 String getSchemaFileName(); 245 246 247 248 /** 249 * Indicates whether the provided object is equal to this attribute type. 250 * 251 * @param o The object for which to make the determination. 252 * 253 * @return {@code true} if the provided object is equal to this attribute 254 * type, or {@code false} if not. 255 */ 256 boolean equals(final Object o); 257 258 259 260 /** 261 * Retrieves a hash code for this attribute type. 262 * 263 * @return A hash code for this attribute type. 264 */ 265 int hashCode(); 266 267 268 269 /** 270 * Retrieves a string representation of this attribute type definition. 271 * 272 * @return A string representation of this attribute type definition. 273 */ 274 String toString(); 275}