/*******************************************************************************
* Copyright 2013 Ericsson Nikola Tesla d.d.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package org.universAAL.ontology.ui.preferences;
import org.universAAL.middleware.owl.ManagedIndividual;
public class PendingMessageBuilderType extends ManagedIndividual {
public static final String MY_URI = UIPreferencesProfileOntology.NAMESPACE
+ "PendingMessageBuilderType";
public static final int SIMPLE_TABLE = 0;
private static final String[] names = { "simpleTable" };
public static final PendingMessageBuilderType simpleTable = new PendingMessageBuilderType(
SIMPLE_TABLE);
private int order;
private PendingMessageBuilderType(int order) {
super(UIPreferencesProfileOntology.NAMESPACE + names[order]);
this.order = order;
}
/**
* @see org.universAAL.middleware.owl.ManagedIndividual#getPropSerializationType
* (java.lang.String)
*/
public int getPropSerializationType(String propURI) {
return PROP_SERIALIZATION_OPTIONAL;
}
/*
* (non-Javadoc)
*
* @see org.universAAL.middleware.owl.ManagedIndividual#isWellFormed()
*/
public boolean isWellFormed() {
return true;
}
public String name() {
return names[order];
}
public int ord() {
return order;
}
/**
* @return number of defined types
*/
public static int getSize() {
return names.length;
}
/** @see org.universAAL.middleware.owl.ManagedIndividual#getClassURI() */
public String getClassURI() {
return MY_URI;
}
public static PendingMessageBuilderType getPendingMessageBuilderTypeByOrder(
int order) {
switch (order) {
case SIMPLE_TABLE:
return simpleTable;
default:
return null;
}
}
public static final PendingMessageBuilderType valueOf(String name) {
if (name == null)
return null;
if (name.startsWith(UIPreferencesProfileOntology.NAMESPACE))
name = name.substring(UIPreferencesProfileOntology.NAMESPACE
.length());
for (int i = SIMPLE_TABLE; i <= SIMPLE_TABLE; i++)
if (names[i].equals(name))
return getPendingMessageBuilderTypeByOrder(i);
return null;
}
}