@Test public void getIndex() { ListValue lv = PropertyValue.createList(); PropertyValue val = new PropertyValue( "k", "v"); lv.addPropertyValue(val); PropertyValue val2 = new PropertyValue( "k2", "v2"); lv.addPropertyValue(val2); assertThat(0).isEqualTo(lv.getIndex(val)); assertThat(1).isEqualTo(lv.getIndex(val2)); PropertyValue val3 = new PropertyValue( "k3", "v"); assertThat(-1).isEqualTo(lv.getIndex(val3)); }
public int getIndex(PropertyValue member) { return this.list.indexOf(member); }
ListValue extends PropertyValue { public int getIndex(PropertyValue member) { return this.list.indexOf(member); } }
ListValue extends PropertyValue { public int getIndex(PropertyValue member) { return this.list.indexOf(member); } ListValue(String key); }
ListValue extends PropertyValue { public int getIndex(PropertyValue member) { return this.list.indexOf(member); } ListValue(String key); @Override ValueType getValueType(); int getIndex(PropertyValue member); @Override int getSize(); @Override Iterator<PropertyValue> iterator(); ListValue addPropertyValue(PropertyValue value); ListValue addValue(String value); ListValue addValues(String... values); ObjectValue addObject(); ListValue addList(); String getValue(int index); PropertyValue getPropertyValue(int n); List<ObjectValue> getObjects(String name); List<ListValue> getLists(String name); List<ListValue> getLists(); List<PropertyValue> getPropertyValues(String name); @Override ObjectValue toObjectValue(); @Override ListValue toListValue(); String getValue(); @Override PropertyValue setValue(String value); @Override ListValue mutable(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static ListValue from(Collection<PropertyValue> values); }
ListValue extends PropertyValue { public int getIndex(PropertyValue member) { return this.list.indexOf(member); } ListValue(String key); @Override ValueType getValueType(); int getIndex(PropertyValue member); @Override int getSize(); @Override Iterator<PropertyValue> iterator(); ListValue addPropertyValue(PropertyValue value); ListValue addValue(String value); ListValue addValues(String... values); ObjectValue addObject(); ListValue addList(); String getValue(int index); PropertyValue getPropertyValue(int n); List<ObjectValue> getObjects(String name); List<ListValue> getLists(String name); List<ListValue> getLists(); List<PropertyValue> getPropertyValues(String name); @Override ObjectValue toObjectValue(); @Override ListValue toListValue(); String getValue(); @Override PropertyValue setValue(String value); @Override ListValue mutable(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static ListValue from(Collection<PropertyValue> values);  }