1 20 21 package org.apache.directory.ldapstudio.browser.core.model; 22 23 24 import java.io.Serializable ; 25 26 import org.apache.directory.ldapstudio.browser.core.BrowserCoreMessages; 27 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.AttributePropertyPageProvider; 28 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.ConnectionPropertyPageProvider; 29 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.EntryPropertyPageProvider; 30 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.ValuePropertyPageProvider; 31 import org.eclipse.core.runtime.IAdaptable; 32 33 34 40 public interface IValue extends Serializable , IAdaptable, ValuePropertyPageProvider, AttributePropertyPageProvider, 41 EntryPropertyPageProvider, ConnectionPropertyPageProvider 42 { 43 44 50 interface EmptyValue 51 { 52 53 58 public String getStringValue(); 59 60 61 66 public byte[] getBinaryValue(); 67 68 69 74 public boolean isString(); 75 76 77 82 public boolean isBinary(); 83 } 84 85 88 public static final EmptyValue EMPTY_STRING_VALUE = new EmptyValue() 89 { 90 91 94 public String toString() 95 { 96 return BrowserCoreMessages.model__empty_string_value; 97 } 98 99 100 103 public boolean isString() 104 { 105 return true; 106 } 107 108 109 112 public boolean isBinary() 113 { 114 return false; 115 } 116 117 118 121 public byte[] getBinaryValue() 122 { 123 return new byte[0]; 124 } 125 126 127 130 public String getStringValue() 131 { 132 return ""; } 134 }; 135 136 139 public static final EmptyValue EMPTY_BINARY_VALUE = new EmptyValue() 140 { 141 142 145 public String toString() 146 { 147 return BrowserCoreMessages.model__empty_binary_value; 148 } 149 150 151 154 public boolean isString() 155 { 156 return false; 157 } 158 159 160 163 public boolean isBinary() 164 { 165 return true; 166 } 167 168 169 172 public byte[] getBinaryValue() 173 { 174 return new byte[0]; 175 } 176 177 178 181 public String getStringValue() 182 { 183 return ""; } 185 }; 186 187 188 193 public abstract IAttribute getAttribute(); 194 195 196 201 public abstract Object getRawValue(); 202 203 204 212 public abstract String getStringValue(); 213 214 215 223 public abstract byte[] getBinaryValue(); 224 225 226 233 public abstract boolean isEmpty(); 234 235 236 241 public abstract boolean isString(); 242 243 244 249 public abstract boolean isBinary(); 250 251 252 257 public abstract boolean isRdnPart(); 258 259 260 271 public abstract boolean equals( Object o ); 272 273 } 274 | Popular Tags |