@Test(expected = Exception.class) public void testSequenceWrongSequence() { ValueMap.map("1", 1, "2"); }
public static ValueMap map(Object... map) { if (map.length / 2 * 2 != map.length) throw new IllegalArgumentException("Arguments should be <String> key - <?> value pairs"); Builder builder = new Builder(); for (int i = 0; i < map.length; i += 2) builder.put((String)map[i], map[i + 1]); return builder.build(); }
ValueMap implements Parcelable { public static ValueMap map(Object... map) { if (map.length / 2 * 2 != map.length) throw new IllegalArgumentException("Arguments should be <String> key - <?> value pairs"); Builder builder = new Builder(); for (int i = 0; i < map.length; i += 2) builder.put((String)map[i], map[i + 1]); return builder.build(); } }
ValueMap implements Parcelable { public static ValueMap map(Object... map) { if (map.length / 2 * 2 != map.length) throw new IllegalArgumentException("Arguments should be <String> key - <?> value pairs"); Builder builder = new Builder(); for (int i = 0; i < map.length; i += 2) builder.put((String)map[i], map[i + 1]); return builder.build(); } ValueMap(Map<String, Object> map); protected  ValueMap(Parcel in); }
ValueMap implements Parcelable { public static ValueMap map(Object... map) { if (map.length / 2 * 2 != map.length) throw new IllegalArgumentException("Arguments should be <String> key - <?> value pairs"); Builder builder = new Builder(); for (int i = 0; i < map.length; i += 2) builder.put((String)map[i], map[i + 1]); return builder.build(); } ValueMap(Map<String, Object> map); protected  ValueMap(Parcel in); static ValueMap empty(); static Builder builder(); static ValueMap map(Object... map); Set<String> keys(); boolean containsKey(String key); T get(String key); T get(String key, T defaultValue); Builder toBuilder(); @Override void writeToParcel(Parcel dest, int flags); @Override int describeContents(); @Override boolean equals(Object other); @Override int hashCode(); }
ValueMap implements Parcelable { public static ValueMap map(Object... map) { if (map.length / 2 * 2 != map.length) throw new IllegalArgumentException("Arguments should be <String> key - <?> value pairs"); Builder builder = new Builder(); for (int i = 0; i < map.length; i += 2) builder.put((String)map[i], map[i + 1]); return builder.build(); } ValueMap(Map<String, Object> map); protected  ValueMap(Parcel in); static ValueMap empty(); static Builder builder(); static ValueMap map(Object... map); Set<String> keys(); boolean containsKey(String key); T get(String key); T get(String key, T defaultValue); Builder toBuilder(); @Override void writeToParcel(Parcel dest, int flags); @Override int describeContents(); @Override boolean equals(Object other); @Override int hashCode(); static final Creator<ValueMap> CREATOR; }