Java 8 Map.Entry - 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 Map.Entry class.

This code example shows how to use the following methods: getKey, getValue
		key = iKey;
		value = iValue;
	} 
 
	public OPair(final Entry<K, V> iSource) {
		key = iSource.getKey();
		value = iSource.getValue();
	} 
 
	public void init(final K iKey, final V iValue) {
		key = iKey;
		value = iValue;
	} 
 
	public K getKey() { 
		return key;
	} 
 
	public V getValue() { 
		return value;
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: getKey, getValue
	 *  
	 * @param entry 
	 *          the entry to copy 
	 */ 
	public OSimpleImmutableEntry(final Entry<? extends K, ? extends V> entry) {
		this.key = entry.getKey();
		this.value = entry.getValue();
	} 
 
	/** 
	 * Returns the key corresponding to this entry. 
	 *  
	 * @return the key corresponding to this entry 
	 */ 
	public K getKey() { 
		return key;
	} 
 
	/** 
	 * Returns the value corresponding to this entry. 
Full Snippet Info
7
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: getKey, getValue
 
    @Override 
    public boolean process(final Entry<BytesKey, OpItem> eldest) {
        try { 
            // ³¢ÊÔ´æÈë´ÅÅÌ 
            return this.diskMap.put(eldest.getKey(), eldest.getValue());
        } 
        catch (final IOException e) {
            e.printStackTrace();
            log.error("дÈë´ÅÅÌ»º´æʧ°Ü", e);
        } 
        return false; 
    } 
 
} 
Full Snippet Info
7
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: getKey, getValue
            } 
 
            @Override 
            public boolean equals(Object obj) { 
                return obj instanceof Map.Entry
                        && key.equals(((Map.Entry<?, ?>) obj).getKey())
                        && value.equals(((Map.Entry<?, ?>) obj).getValue());
            } 
 
            @Override 
            public int hashCode() { 
                return 127 * ("key".hashCode() ^ key.hashCode())
                        + 127 * ("value".hashCode() ^ value.hashCode());
            } 
 
            @Override 
            public String toString() {
                return "MapEntry(" + key + ", " + value + ")";
            } 
        } 
Full Snippet Info
7
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: getValue
  public boolean remove(@Nullable Object o) {
    Predicate<? super Entry<K, V>> entryPredicate = multimap.entryPredicate();
    for (Iterator<Entry<K, V>> unfilteredItr = multimap.unfiltered().entries().iterator();
        unfilteredItr.hasNext();) {
      Map.Entry<K, V> entry = unfilteredItr.next();
      if (entryPredicate.apply(entry) && Objects.equal(entry.getValue(), o)) {
        unfilteredItr.remove();
        return true; 
      } 
    } 
    return false; 
  } 
 
  @Override 
  public boolean removeAll(Collection<?> c) {
    return Iterables.removeIf(multimap.unfiltered().entries(),
        // explicit <Entry<K, V>> is required to build with JDK6 
        Predicates.<Entry<K, V>>and(multimap.entryPredicate(),
            Maps.<V>valuePredicateOnEntries(Predicates.in(c))));
  } 
Full Snippet Info
7
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: getValue
	@Override 
	public IFillerPattern getNextPattern(IFillerPattern currentPattern) { 
		Entry<String, IFillerPattern> pattern = patterns.higherEntry(currentPattern.getUniqueTag()); 
		if (pattern == null) 
			pattern = patterns.firstEntry(); 
		return pattern.getValue(); 
	} 
 
	@Override 
	public IFillerPattern getPreviousPattern(IFillerPattern currentPattern) { 
		Entry<String, IFillerPattern> pattern = patterns.lowerEntry(currentPattern.getUniqueTag()); 
		if (pattern == null) 
			pattern = patterns.lastEntry(); 
		return pattern.getValue(); 
	} 
 
	@Override 
	public Set<ActionFiller> getActions() { 
		return patternActions; 
	} 
Full Snippet Info
7
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: getKey
      } 
       
      private boolean removeEntryIf(Predicate<? super Entry<Range<K>, V>> predicate) {
        List<Range<K>> toRemove = Lists.newArrayList();
        for (Entry<Range<K>, V> entry : entrySet()) {
          if (predicate.apply(entry)) {
            toRemove.add(entry.getKey());
          } 
        } 
        for (Range<K> range : toRemove) {
          TreeRangeMap.this.remove(range);
        } 
        return !toRemove.isEmpty();
      } 
 
      @Override 
      public Set<Range<K>> keySet() {
        return new Maps.KeySet<Range<K>, V>(SubRangeMapAsMap.this) {
          @Override 
          public boolean remove(@Nullable Object o) {
Full Snippet Info
6
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: getValue, setValue
        } 
 
        @Override 
        public ConvertedType getValue() { 
            if (value == null) {
                value = typeConverter.toConvertedType(entry.getValue());
            } 
            return value;
        } 
 
        @Override 
        public ConvertedType setValue(ConvertedType value) {
            ConvertedType old = getValue();
            entry.setValue(typeConverter.toUnconvertedType(value));
            return old;
        } 
 
        @Override 
        public String toString() {
            return entry.toString();
Full Snippet Info
6
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: toString, getKey, getValue
                ^ (e.getValue() == null ? 0 : e.getValue().hashCode()), e
                .hashCode());
    } 
     
    public void test_SimpleEntry_toString() throws Exception { 
        Entry e = new AbstractMap.SimpleEntry<Integer, String>(1, "test");
        assertEquals(e.getKey()+"="+e.getValue(),e.toString());
    } 
     
    /** 
     * @tests serialization/deserialization. 
     */ 
    @SuppressWarnings({ "unchecked", "boxing" }) 
    public void testSerializationSelf_SimpleEntry() throws Exception { 
        Entry e = new AbstractMap.SimpleEntry<Integer, String>(1, "test");
        SerializationTest.verifySelf(e);
    } 
 
    /** 
     * @tests serialization/deserialization compatibility with RI. 
Full Snippet Info
6
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: getKey, getValue
        this.buf = buf;
    } 
 
    @Override 
    public boolean visit(Entry<CharSequence, CharSequence> entry) throws Exception {
        final CharSequence name = entry.getKey();
        final CharSequence value = entry.getValue();
        final ByteBuf buf = this.buf;
        final int nameLen = name.length();
        final int valueLen = value.length();
        final int entryLen = nameLen + valueLen + 4;
        int offset = buf.writerIndex();
        buf.ensureWritable(entryLen);
        writeAscii(buf, offset, name, nameLen);
        offset += nameLen;
        buf.setByte(offset ++, ':');
        buf.setByte(offset ++, ' ');
        writeAscii(buf, offset, value, valueLen);
        offset += valueLen;
        buf.setByte(offset ++, '\r');
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 Map.Entry Questions & Answers:

Other Java 8 Map.Entry Examples

82:	     */
83:	    static void unregister(final Context context, final String regId) {
84:	        Log.i(TAG, "unregistering device (regId = " + regId + ")");
85:	        String serverUrl = SERVER_URL + "/unregister";
86:	        Map<String, String> params = new HashMap<String, String>();

Read More

See Code Examples for Java 8 Map.Entry Methods: