mirror of
https://github.com/Athou/commafeed.git
synced 2026-09-24 04:57:50 +00:00
remove more warnings
This commit is contained in:
@@ -15,6 +15,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.hibernate.annotations.JdbcTypeCode;
|
||||
|
||||
import com.commafeed.backend.feed.FeedUtils;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -27,7 +28,14 @@ import lombok.Setter;
|
||||
public class FeedEntryContent extends AbstractModel {
|
||||
|
||||
public enum Direction {
|
||||
ltr, rtl, unknown
|
||||
@JsonProperty("ltr")
|
||||
LTR,
|
||||
|
||||
@JsonProperty("rtl")
|
||||
RTL,
|
||||
|
||||
@JsonProperty("unknown")
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
@Column(length = 2048)
|
||||
@@ -69,7 +77,7 @@ public class FeedEntryContent extends AbstractModel {
|
||||
|
||||
@Column
|
||||
@Enumerated(EnumType.STRING)
|
||||
private Direction direction = Direction.unknown;
|
||||
private Direction direction = Direction.UNKNOWN;
|
||||
|
||||
@OneToMany(mappedBy = "content")
|
||||
private Set<FeedEntry> entries;
|
||||
@@ -93,9 +101,9 @@ public class FeedEntryContent extends AbstractModel {
|
||||
}
|
||||
|
||||
public boolean isRTL() {
|
||||
if (direction == Direction.rtl) {
|
||||
if (direction == Direction.RTL) {
|
||||
return true;
|
||||
} else if (direction == Direction.ltr) {
|
||||
} else if (direction == Direction.LTR) {
|
||||
return false;
|
||||
} else {
|
||||
// detect on the fly for content that was inserted before the direction field was added
|
||||
|
||||
@@ -14,6 +14,8 @@ import jakarta.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.JdbcTypeCode;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -25,23 +27,54 @@ import lombok.Setter;
|
||||
public class UserSettings extends AbstractModel {
|
||||
|
||||
public enum ReadingMode {
|
||||
all, unread
|
||||
@JsonProperty("all")
|
||||
ALL,
|
||||
|
||||
@JsonProperty("unread")
|
||||
UNREAD;
|
||||
|
||||
// method called for query parameters
|
||||
public static ReadingMode fromString(final String s) {
|
||||
return ReadingMode.valueOf(s.toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
public enum ReadingOrder {
|
||||
asc, desc
|
||||
}
|
||||
@JsonProperty("asc")
|
||||
ASC,
|
||||
|
||||
public enum ViewMode {
|
||||
title, cozy, detailed, expanded
|
||||
@JsonProperty("desc")
|
||||
DESC;
|
||||
|
||||
// method called for query parameters
|
||||
public static ReadingOrder fromString(final String s) {
|
||||
return ReadingOrder.valueOf(s.toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
public enum ScrollMode {
|
||||
always, never, if_needed
|
||||
@JsonProperty("always")
|
||||
ALWAYS,
|
||||
|
||||
@JsonProperty("never")
|
||||
NEVER,
|
||||
|
||||
@JsonProperty("if_needed")
|
||||
IF_NEEDED
|
||||
}
|
||||
|
||||
public enum IconDisplayMode {
|
||||
always, never, on_desktop, on_mobile
|
||||
@JsonProperty("always")
|
||||
ALWAYS,
|
||||
|
||||
@JsonProperty("never")
|
||||
NEVER,
|
||||
|
||||
@JsonProperty("on_desktop")
|
||||
ON_DESKTOP,
|
||||
|
||||
@JsonProperty("on_mobile")
|
||||
ON_MOBILE
|
||||
}
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
|
||||
Reference in New Issue
Block a user