Skip to content
Snippets Groups Projects
Commit 75d456b1 authored by Planoetscher Daniel (Student Com20)'s avatar Planoetscher Daniel (Student Com20)
Browse files

Merge branch 'master' of gitlab.inf.unibz.it:Alex.Zanetti/JSON

parents be9f03ee 4b7d3564
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,17 @@ ...@@ -19,6 +19,17 @@
<artifactId>jakarta.json.bind-api</artifactId> <artifactId>jakarta.json.bind-api</artifactId>
<version>1.0.1</version> <version>1.0.1</version>
</dependency> </dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
import java.util.Arrays;
import java.util.HashMap;
public class Event {
private static final String TYPE = "events";
private String id;
private HashMap<String,String> names;
private String description;
private String url;
private boolean isFree;
private String startDate;
private String endDate;
private String[] categories;
public Event(String id,
HashMap<String, String> names,
String description,
String url,
boolean isFree,
String startDate,
String endDate,
String[] categories
) {
this.id = id;
this.names = names;
this.description = description;
this.url = url;
this.isFree = isFree;
this.startDate = startDate;
this.endDate = endDate;
this.categories = categories;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public HashMap<String, String> getNames() {
return names;
}
public void setNames(HashMap<String, String> names) {
this.names = names;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public boolean isFree() {
return isFree;
}
public void setFree(boolean free) {
isFree = free;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String[] getCategories() {
return categories;
}
public void setCategories(String[] categories) {
this.categories = categories;
}
@Override
public String toString() {
return "Event with the id: " + id + ", names=" + names +
", description='" + description +
", url='" + url +
", isFree=" + isFree +
", startDate='" + startDate +
", endDate='" + endDate +
", categories=" + Arrays.toString(categories);
}
}
\ No newline at end of file
import java.util.Arrays;
public class GeoShape {
private static final String TYPE = "geoShapes";
private String type;
private double[] coordinates;
public GeoShape(String type, double[] coordinates) {
this.type = type;
this.coordinates = coordinates;
}
public double[] getCoordinates() {
return coordinates;
}
public void setCoordinates(double[] coordinates) {
this.coordinates = coordinates;
}
@Override
public String toString() {
return "GeoShape of type: " + type + " and coordinates: " + Arrays.toString(coordinates);
}
}
public class Main { public class Main {
public static void main(String[] args) {
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment