joynr.interlanguagetest.TestInterface Maven / Gradle / Ivy
/*
*
* Copyright (C) 2011 - 2018 BMW Car IT GmbH
*
* 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.
*/
// #####################################################
//#######################################################
//### ###
//## WARNING: This file is generated. DO NOT EDIT ##
//## All changes will be lost! ##
//### ###
//#######################################################
// #####################################################
package joynr.interlanguagetest;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import joynr.interlanguagetest.Enumeration;
import joynr.interlanguagetest.namedTypeCollection1.StructWithStringArray;
import joynr.interlanguagetest.namedTypeCollection2.BaseStruct;
import joynr.interlanguagetest.namedTypeCollection2.BaseStructWithoutElements;
import joynr.interlanguagetest.namedTypeCollection2.ExtendedBaseStruct;
import joynr.interlanguagetest.namedTypeCollection2.ExtendedEnumerationWithPartlyDefinedValues;
import joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct;
import joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedEnumeration;
import joynr.interlanguagetest.namedTypeCollection2.ExtendedInterfaceEnumerationInTypeCollection;
import joynr.interlanguagetest.namedTypeCollection2.ExtendedStructOfPrimitives;
import joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection;
import joynr.interlanguagetest.namedTypeCollection2.MapStringString;
//The current generator is not able to check wether some of the imports are acutally necessary for this specific interface.
//Therefore some imports migth be unused in this version of the interface.
//To prevent warnings @SuppressWarnings("unused") is being used.
//To prevent warnings about an unnecessary SuppressWarnings we have to import something that is not used. (e.g. TreeSet)
import java.util.TreeSet;
@SuppressWarnings("unused")
public interface TestInterface {
public static String INTERFACE_NAME = "interlanguagetest/TestInterface";
/**
*/
public enum MethodWithAnonymousErrorEnumErrorEnum {
/**
*
*/
ERROR_3_1_NTC,
/**
*
*/
ERROR_3_2_NTC,
/**
*
*/
ERROR_3_3_NTC
;
public static final int MAJOR_VERSION = 0;
public static final int MINOR_VERSION = 0;
static final Map ordinalToEnumValues = new HashMap<>();
static{
ordinalToEnumValues.put(0, ERROR_3_1_NTC);
ordinalToEnumValues.put(1, ERROR_3_2_NTC);
ordinalToEnumValues.put(2, ERROR_3_3_NTC);
}
/**
* Get the matching enum for an ordinal number
* @param ordinal The ordinal number
* @return The matching enum for the given ordinal number
*/
public static MethodWithAnonymousErrorEnumErrorEnum getEnumValue(Integer ordinal) {
return ordinalToEnumValues.get(ordinal);
}
/**
* Get the matching ordinal number for this enum
* @return The ordinal number representing this enum
*/
public Integer getOrdinal() {
// TODO should we use a bidirectional map from a third-party library?
Integer ordinal = null;
for(Entry entry : ordinalToEnumValues.entrySet()) {
if(this == entry.getValue()) {
ordinal = entry.getKey();
break;
}
}
return ordinal;
}
}
/**
*/
public enum MethodWithExtendedErrorEnumErrorEnum {
/**
*
*/
ERROR_1_0_TC_2,
/**
*
*/
ERROR_1_1_TC_2,
/**
*
*/
ERROR_1_2_TC_2,
/**
*
*/
ERROR_1_3_TC_2,
/**
*
*/
ERROR_2_1_TC2,
/**
*
*/
ERROR_2_2_TC2,
/**
*
*/
ERROR_2_3_TC2,
/**
*
*/
ERROR_3_1_NTC,
/**
*
*/
ERROR_3_2_NTC,
/**
*
*/
ERROR_3_3_NTC
;
public static final int MAJOR_VERSION = 0;
public static final int MINOR_VERSION = 0;
static final Map ordinalToEnumValues = new HashMap<>();
static{
ordinalToEnumValues.put(0, ERROR_1_0_TC_2);
ordinalToEnumValues.put(1, ERROR_1_1_TC_2);
ordinalToEnumValues.put(2, ERROR_1_2_TC_2);
ordinalToEnumValues.put(3, ERROR_1_3_TC_2);
ordinalToEnumValues.put(21, ERROR_2_1_TC2);
ordinalToEnumValues.put(22, ERROR_2_2_TC2);
ordinalToEnumValues.put(23, ERROR_2_3_TC2);
ordinalToEnumValues.put(24, ERROR_3_1_NTC);
ordinalToEnumValues.put(25, ERROR_3_2_NTC);
ordinalToEnumValues.put(26, ERROR_3_3_NTC);
}
/**
* Get the matching enum for an ordinal number
* @param ordinal The ordinal number
* @return The matching enum for the given ordinal number
*/
public static MethodWithExtendedErrorEnumErrorEnum getEnumValue(Integer ordinal) {
return ordinalToEnumValues.get(ordinal);
}
/**
* Get the matching ordinal number for this enum
* @return The ordinal number representing this enum
*/
public Integer getOrdinal() {
// TODO should we use a bidirectional map from a third-party library?
Integer ordinal = null;
for(Entry entry : ordinalToEnumValues.entrySet()) {
if(this == entry.getValue()) {
ordinal = entry.getKey();
break;
}
}
return ordinal;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy