Skip to content

Commit

Permalink
Merge pull request Okamoba#7 from TomokoKondo/model
Browse files Browse the repository at this point in the history
Create Event Model
  • Loading branch information
TomokoKondo authored Feb 18, 2018
2 parents ee44b8b + 213af53 commit 5dde9c3
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
testCompile 'junit:junit:4.12'

compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-firestore:11.8.0'
}

apply plugin: 'com.google.gms.google-services'
108 changes: 108 additions & 0 deletions app/src/main/java/com/okamoba/okaevent_android/EventModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package com.okamoba.okaevent_android;

import android.support.annotation.NonNull;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
* Created by keiichilo on 2018/02/18.
*/

public class EventModel {
@NonNull private String name = "";
@NonNull private String text = "";
@NonNull private String address = "";
@NonNull private Date start_datetime = new Date();
@NonNull private Date end_datetime = new Date();
@NonNull private String url = "";
@NonNull private String author = "";
@NonNull private String document_id = "";

@NonNull
public String getName() {
return name;
}

public void setName(@NonNull String name) {
this.name = name;
}

@NonNull
public String getText() {
return text;
}

public void setText(@NonNull String text) {
this.text = text;
}

@NonNull
public String getAddress() {
return address;
}

public void setAddress(@NonNull String address) {
this.address = address;
}

@NonNull
public Date getStart_datetime() {
return start_datetime;
}

public void setStart_datetime(@NonNull Date start_datetime) {
this.start_datetime = start_datetime;
}

@NonNull
public Date getEnd_datetime() {
return end_datetime;
}

public void setEnd_datetime(@NonNull Date end_datetime) {
this.end_datetime = end_datetime;
}

@NonNull
public String getUrl() {
return url;
}

public void setUrl(@NonNull String url) {
this.url = url;
}

@NonNull
public String getAuthor() {
return author;
}

public void setAuthor(@NonNull String uid) {
this.author = uid;
}

@NonNull
public String getDocument_id() {
return document_id;
}

public void setDocument_id(@NonNull String document_id) {
this.document_id = document_id;
}

public Map<String, Object> getEvent() {
Map<String, Object> event_map = new HashMap<>();

event_map.put("name", name);
event_map.put("text", text);
event_map.put("address", address);
event_map.put("start_datetime", start_datetime);
event_map.put("end_datetime", end_datetime);
event_map.put("url", url);
event_map.put("author", author);

return event_map;
}
}

0 comments on commit 5dde9c3

Please sign in to comment.