Java 8 LinkedHashMap - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 LinkedHashMap class.

This code example shows how to use the following methods:
 * @author crazybob@google.com (Bob Lee) 
 */ 
public class ToStringBuilder { 
 
    // Linked hash map ensures ordering. 
    final Map<String, Object> map = new LinkedHashMap<String, Object>();
 
    final String name;
 
    public ToStringBuilder(String name) {
        this.name = name;
    } 
 
    public ToStringBuilder(Class type) {
        this.name = type.getSimpleName();
    } 
 
    public ToStringBuilder add(String name, Object value) {
        if (map.put(name, value) != null) {
            throw new RuntimeException("Duplicate names: " + name);
Full Snippet Info
10
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
        if(log.message.startsWith("No MDC")) {
            mdc = Collections.emptyMap();
        } else if(log.message.equals("Null MDC")) {
            mdc = null;
        } else { 
            mdc = new LinkedHashMap<String, Object>();
            mdc.put("messageLength", log.message.length());
        } 
        logger.setMDC(mdc);
 
        switch (log.level()) {
            case 1: 
                logger.error(log.message);
                break; 
            case 2: 
                logger.warning(log.message);
                break; 
            case 3: 
                logger.info(log.message);
                break; 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 * @author crazybob@google.com (Bob Lee) 
 */ 
public class ToStringBuilder { 
 
    // Linked hash map ensures ordering. 
    final Map<String, Object> map = new LinkedHashMap<>();
 
    final String name;
 
    public ToStringBuilder(String name) {
        this.name = name;
    } 
 
    public ToStringBuilder(Class type) {
        this.name = type.getSimpleName();
    } 
 
    public ToStringBuilder add(String name, Object value) {
        if (map.put(name, value) != null) {
            throw new RuntimeException("Duplicate names: " + name);
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: put
 
    } 
 
    @Test 
    public void hkeys() { 
	Map<String, String> hash = new LinkedHashMap<String, String>();
	hash.put("bar", "car");
	hash.put("car", "bar");
	jedis.hmset("foo", hash);
 
	Set<String> keys = jedis.hkeys("foo");
	Set<String> expected = new LinkedHashSet<String>();
	expected.add("bar");
	expected.add("car");
	assertEquals(expected, keys);
 
	// Binary 
	Map<byte[], byte[]> bhash = new LinkedHashMap<byte[], byte[]>();
	bhash.put(bbar, bcar);
	bhash.put(bcar, bbar);
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 * Holds information about a permission attachment on a {@link Permissible} 
 * object 
 */ 
public class PermissionAttachment { 
    private PermissionRemovedExecutor removed;
    private final Map<String, Boolean> permissions = new LinkedHashMap<String, Boolean>();
    private final Permissible permissible;
    private final Plugin plugin;
 
    public PermissionAttachment(Plugin plugin, Permissible Permissible) {
        if (plugin == null) {
            throw new IllegalArgumentException("Plugin cannot be null");
        } else if (!plugin.isEnabled()) {
            throw new IllegalArgumentException("Plugin " + plugin.getDescription().getFullName() + " is disabled");
        } 
 
        this.permissible = Permissible;
        this.plugin = plugin;
    } 
 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 LinkedHashMap Questions & Answers:

See Code Examples for Java 8 LinkedHashMap Methods: