add dummy objects for stream entities

This commit is contained in:
Felix 2017-04-21 01:16:35 +02:00
parent 17c3d7d52f
commit 034cf1ca57
5 changed files with 67 additions and 0 deletions

View file

@ -1,5 +1,6 @@
package de.nicidienase.chaosflix.entities.streaming;
import java.util.ArrayList;
import java.util.List;
/**
@ -10,6 +11,12 @@ public class Group {
String group;
List<Room> rooms;
public Group() {}
public Group(String group) {
this.group = group;
}
public String getGroup() {
return group;
}
@ -25,4 +32,12 @@ public class Group {
public void setRooms(List<Room> rooms) {
this.rooms = rooms;
}
public static Group getDummyObject(){
Group dummy = new Group();
dummy.setGroup("Dummy Group");
dummy.setRooms(new ArrayList<>());
dummy.getRooms().add(Room.getDummyObject());
return dummy;
}
}

View file

@ -1,5 +1,6 @@
package de.nicidienase.chaosflix.entities.streaming;
import java.util.ArrayList;
import java.util.List;
/**
@ -16,6 +17,13 @@ public class LiveConference {
String endsAt;
List<Group> groups;
public LiveConference() {}
public LiveConference(String conference, String description) {
this.conference = conference;
this.description = description;
}
public String getConference() {
return conference;
}
@ -79,4 +87,11 @@ public class LiveConference {
public void setGroups(List<Group> groups) {
this.groups = groups;
}
public static LiveConference getDummyObject(){
LiveConference dummyCon = new LiveConference("DummyCon", "Conference McConferenceface");
dummyCon.setGroups(new ArrayList<>());
dummyCon.getGroups().add(Group.getDummyObject());
return dummyCon;
}
}

View file

@ -3,6 +3,7 @@ package de.nicidienase.chaosflix.entities.streaming;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.ArrayList;
import java.util.List;
/**
@ -17,6 +18,8 @@ public class Room implements Parcelable {
String display;
List<Stream> streams;
public Room() {}
protected Room(Parcel in) {
slug = in.readString();
shedulename = in.readString();
@ -98,4 +101,14 @@ public class Room implements Parcelable {
public void setStreams(List<Stream> streams) {
this.streams = streams;
}
public static Room getDummyObject(){
Room dummy = new Room();
dummy.setStreams(new ArrayList<>());
dummy.getStreams().add(Stream.getDummyObject());
dummy.setDisplay("Dummy Room");
dummy.setSlug("dummy_room");
dummy.setShedulename("Dummy Room");
return dummy;
}
}

View file

@ -3,6 +3,7 @@ package de.nicidienase.chaosflix.entities.streaming;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.HashMap;
import java.util.Map;
/**
@ -17,6 +18,8 @@ public class Stream implements Parcelable {
int[] videoSize;
Map<String, StreamUrl> urls;
public Stream() {}
protected Stream(Parcel in) {
slug = in.readString();
display = in.readString();
@ -98,4 +101,17 @@ public class Stream implements Parcelable {
public void setUrls(Map<String, StreamUrl> urls) {
this.urls = urls;
}
public static Stream getDummyObject(){
Stream dummy = new Stream();
dummy.setDisplay("Dummy");
dummy.setSlug("dummy");
dummy.setTranslated(false);
HashMap<String, StreamUrl> streamMap = new HashMap<>();
streamMap.put("dummy",StreamUrl.getDummyObject());
dummy.setUrls(streamMap);
dummy.setVideoSize(new int[]{1, 1});
dummy.setType("dummy");
return dummy;
}
}

View file

@ -76,4 +76,12 @@ public class StreamUrl implements Parcelable {
dest.writeString(tech);
dest.writeString(url);
}
public static StreamUrl getDummyObject(){
StreamUrl dummy = new StreamUrl();
dummy.setUrl("https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8");
dummy.setTech("dummy");
dummy.setDisplay("DummyStream");
return dummy;
}
}