A wrapper to Properties, to restrict the availability of
values to only those which have a key beginning with some
masking String.
Supported methods to enumerate the list of properties are:
- propertyNames()
- keySet()
- keys()
Other methods including methods returning Entries and values are not supported
| Method from org.hibernate.search.backend.configuration.MaskedProperty Detail: |
public void clear() {
throw new UnsupportedOperationException();
}
|
public Object clone() {
throw new UnsupportedOperationException();
}
|
public boolean contains(Object value) {
initPropertyNames();
return propertyNames.contains( value );
}
|
public boolean containsKey(Object key) {
if ( ! ( key instanceof String ) ) {
throw new IllegalArgumentException( "key must be a String" );
}
return getProperty( key.toString() ) != null;
}
|
public boolean containsValue(Object value) {
throw new UnsupportedOperationException();
}
|
public Enumeration elements() {
//TODO
throw new UnsupportedOperationException();
}
|
public Set entrySet() {
throw new UnsupportedOperationException();
}
|
public boolean equals(Object obj) {
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
final MaskedProperty other = (MaskedProperty) obj;
if ( fallBack == null ) {
if ( other.fallBack != null )
return false;
} else if ( ! fallBack.equals( other.fallBack ) )
return false;
if ( ! masked.equals( other.masked ) )
return false;
if ( ! radix.equals( other.radix ) )
return false;
return true;
}
|
public Object get(Object key) {
throw new UnsupportedOperationException();
}
|
public String getProperty(String key) {
String compositeKey = radix + key;
String value = masked.getProperty( compositeKey );
if ( value != null) {
log.trace( "found a match for key: [{}] value: {}", compositeKey, value );
return value;
}
else if ( fallBack != null ) {
return fallBack.getProperty( key );
}
else {
return null;
}
}
|
public String getProperty(String key,
String defaultValue) {
String val = getProperty( key );
return ( val == null ) ? defaultValue : val;
}
|
public int hashCode() {
final int prime = 31;
int result = ( ( fallBack == null ) ? 0 : fallBack.hashCode() );
result = prime * result + masked.hashCode();
result = prime * result + radix.hashCode();
return result;
}
|
public boolean isEmpty() {
initPropertyNames();
return propertyNames.isEmpty();
}
|
public Set keySet() {
initPropertyNames();
return propertyNames;
}
|
public Enumeration keys() {
initPropertyNames();
return Collections.enumeration( propertyNames );
}
|
public void list(PrintStream out) {
throw new UnsupportedOperationException();
}
|
public void list(PrintWriter out) {
throw new UnsupportedOperationException();
}
|
public void load(InputStream inStream) throws IOException {
throw new UnsupportedOperationException();
}
|
public void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException {
throw new UnsupportedOperationException();
}
|
public Enumeration propertyNames() {
initPropertyNames();
return Collections.enumeration( propertyNames );
}
|
public Object put(Object key,
Object value) {
throw new UnsupportedOperationException();
}
|
public void putAll(Map t) {
throw new UnsupportedOperationException();
}
|
protected void rehash() {
throw new UnsupportedOperationException();
}
|
public Object remove(Object key) {
throw new UnsupportedOperationException();
}
|
public void save(OutputStream out,
String comments) {
throw new UnsupportedOperationException();
}
|
public Object setProperty(String key,
String value) {
throw new UnsupportedOperationException();
}
|
public int size() {
initPropertyNames();
return propertyNames.size();
}
|
public void store(OutputStream out,
String comments) throws IOException {
throw new UnsupportedOperationException();
}
|
public void storeToXML(OutputStream os,
String comment) throws IOException {
throw new UnsupportedOperationException();
}
|
public void storeToXML(OutputStream os,
String comment,
String encoding) throws IOException {
throw new UnsupportedOperationException();
}
|
public String toString() {
return masked.toString();
}
|
public Collection values() {
throw new UnsupportedOperationException();
}
|