/* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.vinidsl.googleioextended.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.j256.ormlite.field.DatabaseField; import com.vinidsl.googleioextended.R; import java.util.Random; /** * Created by Vinicius on 09-06-15. */ @JsonIgnoreProperties(ignoreUnknown = true) public class Talk extends BaseModel{ @JsonProperty @DatabaseField private String description; @JsonProperty @DatabaseField private Integer place; @JsonProperty @DatabaseField private Integer order; @JsonProperty @DatabaseField(foreign = true,foreignAutoCreate = true,foreignAutoRefresh = true) private Speaker speaker; @JsonProperty @DatabaseField private String title; @DatabaseField private Boolean scheduled; @JsonProperty @DatabaseField private String date; @JsonProperty @DatabaseField private String room; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public Speaker getSpeaker() { return speaker; } public void setSpeaker(Speaker speaker) { this.speaker = speaker; } public Integer getPlace() { return place; } public void setPlace(Integer place) { this.place = place; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Boolean isScheduled() { return scheduled; } public void setScheduled(Boolean scheduled) { this.scheduled = scheduled; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } public Integer getOrder() { return order; } public void setOrder(Integer order) { this.order = order; } public String getRoom() { return room; } public void setRoom(String room) { this.room = room; } private static final Random RANDOM = new Random(); public static int getRandomCheeseDrawable() { switch (RANDOM.nextInt(4)) { default: case 0: return R.drawable.material1; case 1: return R.drawable.material2; case 2: return R.drawable.material3; case 3: return R.drawable.material4; } } }