Twidere-App-Android-Twitter.../twidere.component.common/src/main/java/org/mariotaku/microblog/library/twitter/model/ScheduledStatus.java

103 lines
2.6 KiB
Java
Raw Normal View History

2015-07-06 17:04:25 +02:00
/*
* Twidere - Twitter client for Android
2015-07-06 17:04:25 +02:00
*
2017-04-20 16:18:45 +02:00
* Copyright 2012-2017 Mariotaku Lee <mariotaku.lee@gmail.com>
2015-07-06 17:04:25 +02:00
*
2017-04-20 16:18:45 +02:00
* 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
2015-07-06 17:04:25 +02:00
*
2017-04-20 16:18:45 +02:00
* 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.
2015-07-06 17:04:25 +02:00
*/
2016-05-13 07:08:02 +02:00
package org.mariotaku.microblog.library.twitter.model;
2015-07-06 17:04:25 +02:00
2016-01-20 04:52:08 +01:00
import android.support.annotation.StringDef;
2015-12-13 14:30:14 +01:00
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
2016-05-13 07:08:02 +02:00
import org.mariotaku.microblog.library.twitter.util.TwitterDateConverter;
2015-10-21 15:53:46 +02:00
2016-03-07 03:43:09 +01:00
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
2015-07-06 17:04:25 +02:00
import java.util.Date;
/**
* Created by mariotaku on 15/7/6.
*/
2015-12-13 14:30:14 +01:00
@JsonObject
public class ScheduledStatus {
@JsonField(name = "updated_at", typeConverter = TwitterDateConverter.class)
Date updatedAt;
@JsonField(name = "created_at", typeConverter = TwitterDateConverter.class)
Date createdAt;
@JsonField(name = "execute_at", typeConverter = TwitterDateConverter.class)
Date executeAt;
@JsonField(name = "text")
String text;
@JsonField(name = "media_ids")
long[] mediaIds;
@JsonField(name = "id")
long id;
@JsonField(name = "possiblySensitive")
boolean possiblySensitive;
@JsonField(name = "user_id")
long userId;
2016-01-20 04:52:08 +01:00
@JsonField(name = "state")
@State
String state;
2015-12-13 14:30:14 +01:00
public long getUserId() {
return userId;
}
2015-07-17 16:30:41 +02:00
2015-12-13 14:30:14 +01:00
public boolean isPossiblySensitive() {
return possiblySensitive;
}
2015-07-17 16:30:41 +02:00
2015-12-13 14:30:14 +01:00
public long getId() {
return id;
}
2015-07-17 16:30:41 +02:00
2015-12-13 14:30:14 +01:00
public long[] getMediaIds() {
return mediaIds;
}
2015-07-06 17:04:25 +02:00
2015-12-13 14:30:14 +01:00
public Date getUpdatedAt() {
return updatedAt;
}
2015-07-06 17:04:25 +02:00
2015-12-13 14:30:14 +01:00
public Date getCreatedAt() {
return createdAt;
}
2015-07-06 17:04:25 +02:00
2015-12-13 14:30:14 +01:00
public Date getExecuteAt() {
return executeAt;
}
2015-07-06 17:04:25 +02:00
2015-12-13 14:30:14 +01:00
public String getText() {
return text;
}
2015-07-17 16:30:41 +02:00
2016-01-20 04:52:08 +01:00
public
@State
String getState() {
2015-12-13 14:30:14 +01:00
return state;
}
2015-07-17 16:30:41 +02:00
2016-01-20 04:52:08 +01:00
@StringDef({State.SCHEDULED, State.FAILED, State.CANCELED})
@Retention(RetentionPolicy.SOURCE)
2016-01-20 04:52:08 +01:00
public @interface State {
String SCHEDULED = "scheduled", FAILED = "failed", CANCELED = "canceled";
2016-01-20 04:52:08 +01:00
2015-07-17 16:30:41 +02:00
}
2015-07-06 17:04:25 +02:00
}