Example usage for org.apache.commons.collections4.keyvalue DefaultMapEntry DefaultMapEntry

List of usage examples for org.apache.commons.collections4.keyvalue DefaultMapEntry DefaultMapEntry

Introduction

In this page you can find the example usage for org.apache.commons.collections4.keyvalue DefaultMapEntry DefaultMapEntry.

Prototype

public DefaultMapEntry(final K key, final V value) 

Source Link

Document

Constructs a new entry with the specified key and given value.

Usage

From source file:au.com.ogsoft.yahaml4j.Haml.java

private Map.Entry<String, String> _attribute(Tokeniser tokeniser, HamlOptions options) {
    Map.Entry<String, String> attr = null;

    if (tokeniser.getToken().type == Token.TokenType.HTMLIDENTIFIER) {
        String name = tokeniser.getToken().getTokenString();
        tokeniser.getNextToken();//  w ww .j  a  va2s . c  o  m
        _whitespace(tokeniser);
        if (tokeniser.getToken().type != Token.TokenType.EQUAL) {
            _handleError(options, null, tokeniser,
                    new RuntimeException(tokeniser.parseError("Expected equals \"=\" after attribute name")));
            return null;
        }
        tokeniser.getNextToken();
        _whitespace(tokeniser);
        if (tokeniser.getToken().type != Token.TokenType.HTMLIDENTIFIER
                && tokeniser.getToken().type != Token.TokenType.STRING) {
            _handleError(options, null, tokeniser, new RuntimeException(
                    tokeniser.parseError("Expected a quoted string or an identifier for the attribute value")));
            return null;
        }
        attr = new DefaultMapEntry<String, String>(name, tokeniser.getToken().getTokenString());
        tokeniser.getNextToken();
    }

    return attr;
}

From source file:org.kuali.coeus.propdev.impl.person.KeyPersonnelAuditRule.java

/**
 * Convenience method for creating a <code>{@link SimpleEntry}</code> out of a key/value pair
 * /*from ww w.ja  va 2s  .  c om*/
 * @param key
 * @param value
 * @return SimpleImmutableEntry
 */
private Entry<String, String> keyValue(String key, String value) {
    return new DefaultMapEntry(key, value);
}

From source file:org.kuali.coeus.sys.framework.rule.KcTransactionalDocumentRuleBase.java

/**
 * Convenience method for creating a <code>{@link SimpleEntry}</code> out of a key/value pair
 * //from  w  w w  .jav  a2  s. c  om
 * @param key
 * @param value
 * @return SimpleImmutableEntry
 */
protected Entry<String, String> keyValue(String key, Object value) {

    @SuppressWarnings("unchecked") //Commons Collections does not support Generics
    final Entry<String, String> entry = (value == null) ? new DefaultMapEntry(key, "")
            : new DefaultMapEntry(key, value.toString());

    return entry;
}