Package com.eclipsesource.json.JsonObject

Examples of com.eclipsesource.json.JsonObject.Member


      }

      public Member next() {
        String name = namesIterator.next();
        JsonValue value = valuesIterator.next();
        return new Member( name, value );
      }

      public void remove() {
        throw new UnsupportedOperationException();
      }
View Full Code Here


        return false;
      }
      if( getClass() != obj.getClass() ) {
        return false;
      }
      Member other = (Member)obj;
      return name.equals( other.name ) && value.equals( other.value );
    }
View Full Code Here

  @Test
  public void iterator_nextReturnsActualValue() {
    object.add( "a", true );
    Iterator<Member> iterator = object.iterator();

    assertEquals( new Member( "a", JsonValue.TRUE ), iterator.next() );
  }
View Full Code Here

    object.add( "b", false );
    Iterator<Member> iterator = object.iterator();

    iterator.next();
    assertTrue( iterator.hasNext() );
    assertEquals( new Member( "b", JsonValue.FALSE ), iterator.next() );
  }
View Full Code Here

    assertEquals( 23, deserializedObject.get( "foo" ).asInt() );
  }

  @Test
  public void member_returnsNameAndValue() {
    Member member = new Member( "a", JsonValue.TRUE );

    assertEquals( "a", member.getName() );
    assertEquals( JsonValue.TRUE, member.getValue() );
  }
View Full Code Here

    assertEquals( JsonValue.TRUE, member.getValue() );
  }

  @Test
  public void member_equals_trueForSameInstance() {
    Member member = new Member( "a", JsonValue.TRUE );

    assertTrue( member.equals( member ) );
  }
View Full Code Here

    assertTrue( member.equals( member ) );
  }

  @Test
  public void member_equals_trueForEqualObjects() {
    Member member = new Member( "a", JsonValue.TRUE );

    assertTrue( member.equals( new Member( "a", JsonValue.TRUE ) ) );
  }
View Full Code Here

    assertTrue( member.equals( new Member( "a", JsonValue.TRUE ) ) );
  }

  @Test
  public void member_equals_falseForDifferingObjects() {
    Member member = new Member( "a", JsonValue.TRUE );

    assertFalse( member.equals( new Member( "b", JsonValue.TRUE ) ) );
    assertFalse( member.equals( new Member( "a", JsonValue.FALSE ) ) );
  }
View Full Code Here

    assertFalse( member.equals( new Member( "a", JsonValue.FALSE ) ) );
  }

  @Test
  public void member_equals_falseForNull() {
    Member member = new Member( "a", JsonValue.TRUE );

    assertFalse( member.equals( null ) );
  }
View Full Code Here

    assertFalse( member.equals( null ) );
  }

  @Test
  public void member_equals_falseForSubclass() {
    Member member = new Member( "a", JsonValue.TRUE );

    assertFalse( member.equals( new Member( "a", JsonValue.TRUE ) {} ) );
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.json.JsonObject.Member

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.