BAEL-1979 Added examples for SnakeYAML Library (#4802)

* BAEL-1979 Added examples for SnakeYAML Library

* BAEL-1979 Moved the snakeyaml related code to libraries module

* BAEL-1979 Removed the System.out.println() statements and converted the assertTrue to assertEquals wherever possible.

* BAEL-1979 Removed println statements, small formatting fix in pom.xml
This commit is contained in:
sandy03934
2018-07-30 19:00:43 +05:30
committed by Predrag Maric
parent ca1908a351
commit 1bae07cc5c
14 changed files with 360 additions and 4 deletions
@@ -0,0 +1,41 @@
package com.baeldung.snakeyaml;
public class Address {
private String line;
private String city;
private String state;
private Integer zip;
public String getLine() {
return line;
}
public void setLine(String line) {
this.line = line;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Integer getZip() {
return zip;
}
public void setZip(Integer zip) {
this.zip = zip;
}
}
@@ -0,0 +1,26 @@
package com.baeldung.snakeyaml;
public class Contact {
private String type;
private int number;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
}
@@ -0,0 +1,53 @@
package com.baeldung.snakeyaml;
import java.util.List;
public class Customer {
private String firstName;
private String lastName;
private int age;
private List<Contact> contactDetails;
private Address homeAddress;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public List<Contact> getContactDetails() {
return contactDetails;
}
public void setContactDetails(List<Contact> contactDetails) {
this.contactDetails = contactDetails;
}
public Address getHomeAddress() {
return homeAddress;
}
public void setHomeAddress(Address homeAddress) {
this.homeAddress = homeAddress;
}
}