io.joynr.generator.cpp.util.CommonApiJoynrGeneratorExtensions Maven / Gradle / Ivy
package io.joynr.generator.cpp.util;
import com.google.common.base.Objects;
import io.joynr.generator.util.JoynrGeneratorExtensions;
import org.franca.core.franca.FAttribute;
import org.franca.core.franca.FBasicTypeId;
@SuppressWarnings("all")
public abstract class CommonApiJoynrGeneratorExtensions extends JoynrGeneratorExtensions {
public String getPrimitiveTypeName(final FBasicTypeId basicType) {
String _switchResult = null;
boolean _matched = false;
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.BOOLEAN)) {
_matched=true;
_switchResult = "bool";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.INT8)) {
_matched=true;
_switchResult = "qint8";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.UINT8)) {
_matched=true;
_switchResult = "qint8";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.INT16)) {
_matched=true;
_switchResult = "int";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.UINT16)) {
_matched=true;
_switchResult = "int";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.INT32)) {
_matched=true;
_switchResult = "int";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.UINT32)) {
_matched=true;
_switchResult = "int";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.INT64)) {
_matched=true;
_switchResult = "qint64";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.UINT64)) {
_matched=true;
_switchResult = "qint64";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.FLOAT)) {
_matched=true;
_switchResult = "double";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.DOUBLE)) {
_matched=true;
_switchResult = "double";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.STRING)) {
_matched=true;
_switchResult = "QString";
}
}
if (!_matched) {
if (Objects.equal(basicType,FBasicTypeId.BYTE_BUFFER)) {
_matched=true;
_switchResult = "CommonAPI::ByteBuffer";
}
}
if (!_matched) {
String _name = basicType.name();
String _plus = ("Unsupported basic type: " + _name);
IllegalArgumentException _illegalArgumentException = new IllegalArgumentException(_plus);
throw _illegalArgumentException;
}
return _switchResult;
}
public boolean isReadonly(final FAttribute fAttribute) {
boolean _isReadonly = fAttribute.isReadonly();
return _isReadonly;
}
public boolean isObservable(final FAttribute fAttribute) {
boolean _isNoSubscriptions = fAttribute.isNoSubscriptions();
boolean _not = (!_isNoSubscriptions);
return _not;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy