Replies the default value for the given type.
@param type the type for which the default value should be determined.
@return the default value.
558506
@Pure
	public String getDefaultValueForType(String type) {
		//TODO: Check if a similar function exists in the Xbase library.
		String defaultValue = "";
		if (!Strings.isEmpty(type) && !"void".equals(type)) {
			switch (type) {
			case "boolean":
				defaultValue = "true";
				break;
			case "double":
				defaultValue = "0.0";
				break;
			case "float":
				defaultValue = "0.0f";
				break;
			case "int":
				defaultValue = "0";
				break;
			case "long":
				defaultValue = "0";
				break;
			case "byte":
				defaultValue = "(0 as byte)";
				break;
			case "short":
				defaultValue = "(0 as short)";
				break;
			case "char":
				defaultValue = "(0 as char)";
				break;
			default:
				defaultValue = "null";
				break;
			}
		}
		return defaultValue;
	}
1154818
public static <T> TypeReference<T> get(Class<T> type) {
		return new SimpleTypeReference<T>(type);
	}
1177609
public static String getExample(TypeDeclaration type) {
		if (type == null || type.example() == null) {
			return null;
		} else {
			return type.example().value();
		}
	}
953883
def set_default(self, default):  # type: (typing.Any) -> None
        
        if default is not None and len(default) > 1 and default[0] == '"' and default[-1] == '"':
            default = default[1:-1]
        self.defaultValue = default
702750
protected static Type getTypeReference(Object type) {
        if (type instanceof Type) {
            return (Type) type;
        } else if (type instanceof Class) {
            return Type.getType((Class) type);
        } else if (type instanceof String) {
            String className = type.toString();

            String internalName = getInternalName(className);
            if (className.endsWith("[]")) {
                internalName = "[L" + internalName + ";";
            }
            return Type.getObjectType(internalName);
        } else {
            throw new IllegalArgumentException("Type reference [" + type + "] should be a Class or a String representing the class name");
        }
    }
986122
public String getDefaultValue() {

        String value = null;
        if (!m_defaultValues.isEmpty()) {
            value = m_defaultValues.get(m_defaultValues.size() - 1);
        }
        return value;
    }
739869
public static Object getPrimitiveDefaultValue(final Class<?> type) {
        ArgUtils.notNull(type, "type");

        if(!type.isPrimitive()) {
            return null;
        }

        if(type.equals(boolean.class)) {
            return false;

        } else if(type.equals(char.class)) {
            return '\u0000';

        } else if(type.equals(byte.class)) {
            return (byte)0;

        } else if(type.equals(short.class)) {
            return (short)0;

        } else if(type.equals(int.class)) {
            return 0;

        } else if(type.equals(long.class)) {
            return 0l;

        } else if(type.equals(float.class)) {
            return 0.0f;

        } else if(type.equals(double.class)) {
            return 0.0d;

        }

        return null;
    }
513840
public T getDefaultValue() {
		if (defaultValue != null) {
			if (serializer != null) {
				return serializer.copy(defaultValue);
			} else {
				throw new IllegalStateException("Serializer not yet initialized.");
			}
		} else {
			return null;
		}
	}
1081000
public <T> T convert(Type type, Object value, T defaultValue) throws ConvertException {
		return convert(type, value, defaultValue, true);
	}
1230839
public final <T> Optional<T> getValue(Class<T> type) {
        return getValue(ConversionContext.of(type));
    }
1574
protected TypeValuePairType getTypeValuePair(String type, byte[] value) {
        TypeValuePairType tvp = new TypeValuePairType();
        tvp.setType(type);
        //tvp.setValue(Base64.encodeBase64Chunked(value));
        // the TVP itself base64 encodes now, no need for this
        tvp.setValue(value);
        return tvp;
    }
1047527
public JSType createOptionalType(JSType type) {
    if (type instanceof UnknownType || type.isAllType()) {
      return type;
    } else {
      return createUnionType(type, getNativeType(JSTypeNative.VOID_TYPE));
    }
  }
1038767
public Type resolveType(Type type) {
        if (type instanceof Class) {
            Type resolvedType = types.get(type);
            if (resolvedType != null) {
                return resolvedType;
            }
        }
        return resolver.resolveType(type);
    }
691707
public static Type resolveRefType(Type type) {
        if (type == null)
            return null;

        if (type instanceof RefType)
            return resolveRefType(((RefType) type).getRefType());
        else
            return type;
    }
145770
@Override
	public Object getDefaultValue() {

		Indexed indexedAnnotation = getIndexAnnotation();
		if (indexedAnnotation != null && StringUtils.hasText(indexedAnnotation.defaultValue())) {
			return indexedAnnotation.defaultValue();
		}
		return null;
	}
735576
public static DAType getPreferredInt(DAType type) {
        if (type.isInMemory())
            return type.isStoring() ? RAM_INT_STORE : RAM_INT;
        return type;
    }
1336707
public Optional<Object> getDefaultValue() {
        Validate.notNull(parameter, "parameter must not be null!");
        if (parameter instanceof AbstractSerializableParameter) {
            AbstractSerializableParameter serializableParameter = (AbstractSerializableParameter) parameter;
            return Optional.ofNullable(serializableParameter.getDefaultValue());
        }
        return Optional.empty();
    }