/*
This function takes in the message type and returns it as a string.

@param type This is the error type.
355448
private String getTypeString(final Type type) {
        if (type == null) return null;
        switch (type) {
            case ERROR:
                return "ERROR";
            case INFO:
                return "INFO";
            case WARN:
                return "WARN";
            case DEBUG:
                return "DEBUG";
        }
        return null;
    }
591135
function typeChecker(type) {
  var typeString = "[object " + type + "]";
  return function(value) {
    return Object.prototype.toString.call(value) === typeString;
  };
}
943288
protected int getRequestTypeFromString(String requestType) {
        if ("GET".equals(requestType)) {
            return REQUEST_TYPE_GET;
        }
        if ("POST".equals(requestType)) {
            return REQUEST_TYPE_POST;
        }
        if ("PUT".equals(requestType)) {
            return REQUEST_TYPE_PUT;
        }
        if ("DELETE".equals(requestType)) {
            return REQUEST_TYPE_DELETE;
        }
        return REQUEST_TYPE_ALL;
    }
518792
public static String toStringWithNamedGenerics(final Class<?> type) {
        return toStringType(new ParameterizedTypeImpl(type, type.getTypeParameters()), new PrintableGenericsMap());
    }
751818
function exception(type) {
	
	var message = errors[type];
	
	for(var i = 1; i < arguments.length; i++)
		message = message.replace('%', arguments[i].toString().replace(/\((.|\r\n|\n|\r)*/gm, ''));
	
	return "Exception: " + message;
}
777619
function(type) {
		//define if put type is present in config
		if (config.moduleTypes.indexOf(type) > -1) {
            config.moduleType = type;
            fs.writeFile(path.resolve(__dirname, 'config.json'), JSON.stringify(config, null, 4), 'utf8', function (err) {
                if (err) {
                    return console.log(err);
                }
            });
		} else {
			return console.log('Wrong type, available types: %j', config.moduleTypes);
		}
	}
849893
protected void decodeMessage(byte type, byte from, byte dest, DataInputStream buffer) throws IOException
    {
        final NetworkMessage message = decoder.getNetworkMessageFromType(type);
        if (message != null)
        {
            final int skip = 3;
            if (buffer.skipBytes(skip) == skip)
            {
                message.decode(type, from, dest, buffer);
                messagesIn.add(message);
            }
        }
    }
170493
function log (type) {
  return (...message) => {
    if (!message.length) {
      return
    }

    const { colorFn, icon } = getColorFnAndIconByType(type)
    const output = ['']

    message.forEach((item, index) => {
      if (index === 0) {
        output.push(`  ${icon} ${item}`)
        return
      }

      output.push(`    ${item}`)
    })

    output.push('')

    console.log(colorFn(output.join('\n')))
  }
}
1244319
public <T> Stringifier<T> getStringifier(Class<? extends T> type, String subType) {
		return compositeStringifier.getForType(type, subType);
	}
153073
protected String argumentTypeString(final Type type) {
        if (type instanceof ParameterizedType) {
            final ParameterizedType parameterizedType = (ParameterizedType) type;
            final List<String> subs = new ArrayList<>();
            for (final Type actualType : parameterizedType.getActualTypeArguments())
                subs.add(argumentTypeString(actualType));
            return argumentTypeString(((ParameterizedType) type).getRawType()) + "[" + String.join(",", subs) + "]";
        } else if (type instanceof GenericArrayType) {
            return argumentTypeString(((GenericArrayType) type).getGenericComponentType()) + "[]";
        } else if (type instanceof WildcardType) {
            throw new RuntimeException("We don't support wildcards in arguments: " + type);
        } else if (type instanceof Class<?>) {
            return ((Class) type).getSimpleName();
        } else {
            throw new DocException("Unknown type: " + type);
        }
    }
93433
public java.lang.String getErrorMessage() {
    java.lang.Object ref = errorMessage_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (bs.isValidUtf8()) {
        errorMessage_ = s;
      }
      return s;
    }
  }
58611
public String getType() {
        Object type = getHeader(JmsMessageHeaders.TYPE);

        if (type != null) {
            return type.toString();
        }

        return null;
    }
636657
private void setType(String type) {
        requireArgument(type != null && !type.trim().isEmpty(), "Type cannot be null or empty.");
        _type = type;
    }
165642
public static String getResultSetTypeString(int type) {
        switch (type) {
            case ResultSet.TYPE_FORWARD_ONLY:
                return "TYPE FORWARD ONLY (" + type + ')'; 

            case ResultSet.TYPE_SCROLL_INSENSITIVE:
                return "TYPE SCROLL INSENSITIVE (" + type + ')'; 

            case ResultSet.TYPE_SCROLL_SENSITIVE:
                return "TYPE SCROLL SENSITIVE (" + type + ')'; 

            case TYPE_SS_SCROLL_DYNAMIC: 
                return "TYPE SS SCROLL DYNAMIC (" + type + ')'; 

            case TYPE_SS_DIRECT_FORWARD_ONLY: 
                return "TYPE SS DIRECT FORWARD ONLY (" + type + ')'; 

            case TYPE_SS_SERVER_CURSOR_FORWARD_ONLY: 
                return "TYPE SS SERVER CURSOR FORWARD ONLY (" + type + ')'; 
        }

        return "UNKNOWN RESULT SET TYPE CONSTANT (" + type + ')'; 
    }
1090446
private void writeType(String type)
        throws IOException
    {
        flushIfFull();

        int len = type.length();
        if (len == 0) {
            throw new IllegalArgumentException("empty type is not allowed");
        }

        if (_typeRefs == null)
            _typeRefs = new HashMap<String, Integer>();

        Integer typeRefV = (Integer) _typeRefs.get(type);

        if (typeRefV != null) {
            int typeRef = typeRefV.intValue();

            writeInt(typeRef);
        }
        else {
            _typeRefs.put(type, Integer.valueOf(_typeRefs.size()));

            writeString(type);
        }
    }
775273
public final MessageType getJsMessageType() {
        /* Get the int value and get the corresponding MessageType to return */
        Byte mType = (Byte) jmo.getField(JsHdrAccess.MESSAGETYPE);
        return MessageType.getMessageType(mType);
    }
608629
public String convert(String type) {
		if (isImplicitSarlTypes() && type.startsWith(IMPLICIT_PACKAGE)) {
			return type;
		}
		if (this.mapping == null) {
			this.mapping = initMapping();
		}
		final String map = this.mapping.get(type);
		if (map != null) {
			if (map.isEmpty() && !isImplicitJvmTypes()) {
				return null;
			}
			return map;
		}
		if (isImplicitJvmTypes()) {
			return type;
		}
		return null;
	}