Skip to content

Commit

Permalink
Code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sfuhrm committed Jan 12, 2024
1 parent c99ab22 commit 51bcdc7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ List<String> apiUrls() throws UnknownHostException {
@Value
static class DiscoveryResult {
/** The endpoint address for this result. */
private String endpoint;
String endpoint;
/** The connection and retrieval duration in milliseconds. */
private long duration;
long duration;
/** The stats read from the endpoint. */
private Stats stats;
Stats stats;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
/** Parameters for list calls.
* @author Stephan Fuhrmann
* */
@Getter
@Slf4j
@ToString
public final class ListParameter extends ParameterProvider {
/** The field name to sort by. */
@Getter
private FieldName order;

/** Whether to sort in reverse order. */
@Getter
private Boolean reverseOrder;

/** Private constructor.
Expand Down
37 changes: 2 additions & 35 deletions radiobrowser4j/src/main/java/de/sfuhrm/radiobrowser4j/Station.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,37 @@
* Representation of a Radio Station.
* @author Stephan Fuhrmann
*/
@Setter
@Getter
@EqualsAndHashCode(of = {"stationUUID", "name"})
public final class Station extends ParameterProvider {
/** A globally unique identifier for the change
* of the station information. */
@Getter @Setter
private UUID changeUUID;

/** A globally unique identifier for the station. */
@Getter @Setter
private UUID stationUUID;

/** The name of the station. */
@Getter @Setter
private String name;

/** The URL of the stream. */
@Getter @Setter
private String url;

/** An automatically "resolved" stream URL. */
@Getter @Setter
private String urlResolved;

/** The URL of the stations' homepage. */
@Getter @Setter
private String homepage;

/** The URL of the stations' favicon. */
@Getter @Setter
private String favicon;

/** The tags for this station as a list.
* The comma separated version can be obtained using
* {@link #getTags()}.
* @see #getTags()
* */
@Getter @Setter
private List<String> tagList = new ArrayList<>();

/** The country this station is located at.
Expand All @@ -76,96 +70,69 @@ public final class Station extends ParameterProvider {
* @see <a href="https://api.radio-browser.info/">api.radio-browser.info</a>
* */
@Deprecated
@Getter @Setter
private String country;

/** Official country codes according to ISO 3166-1 alpha-2. */
@Getter @Setter
private String countryCode;

/** The state this station is located at. */
@Getter @Setter
private String state;

/** The languages of this station as a list.
* The comma separated version can be obtained using
* {@link #getLanguage()}.
* @see #getLanguage()
*/
@Getter @Setter
private List<String> languageList = new ArrayList<>();

/** The votes for this station. */
@Getter @Setter
private Integer votes;

/** The codec used for the stream. */
@Getter @Setter
private String codec;

/** The bitrate used for the stream. */
@Getter @Setter
private Integer bitrate;

/** Mark if this stream is using HLS distribution or non-HLS. */
@Getter @Setter
private String hls;

/** The current online/offline state of this stream. */
@Getter @Setter
private Integer lastcheckok;

/** The last time when any Radio-Browser server checked
* the online state of this stream. */
@Getter
@Setter
private Date lastchecktime;

/** The last time when the stream was checked for
* the online status with a positive result. */
@Getter
@Setter
private Date lastcheckoktime;

/** The last time when this server checked the online state
* and the metadata of this stream. */
@Getter
@Setter
private Date lastlocalchecktime;

/** The time of the last click recorded for this stream. */
@Getter
@Setter
private Date clicktimestamp;

/** Clicks within the last 24 hours. */
@Getter @Setter
private Integer clickcount;

/** The difference of the click counts within the last 2 days. */
@Getter @Setter
private Integer clicktrend;

/** Timestamp of the last change of the stations' data. */
@Getter
@Setter
private Date lastchangetime;

/** Geo latitude of the station. */
@Getter
@Setter
private Double geoLatitude;

/** Geo longitude of the station. */
@Getter
@Setter
private Double geoLongitude;

/** Is true, if the stream owner does
* provide extended information as HTTP headers
* which override the information in the database. */
@Getter
@Setter
private Boolean hasExtendedInfo;

/** JSON getter for the {@link #tagList}.
Expand Down
12 changes: 2 additions & 10 deletions radiobrowser4j/src/main/java/de/sfuhrm/radiobrowser4j/Stats.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,38 @@
* Representation of an api endpoint statistic.
* @author Stephan Fuhrmann
*/
@Setter
@Getter
public final class Stats {

/** The supported version. */
@Getter @Setter
private Integer supportedVersion;

/** The version of the API. */
@Getter @Setter
private String softwareVersion;

/** The status, should be "OK". */
@Getter @Setter
private String status;

/** The number of stations stored on the server. */
@Getter @Setter
private Integer stations;

/** The number of broken stations. */
@Getter @Setter
private Integer stationsBroken;

/** The number of tags. */
@Getter @Setter
private Integer tags;

/** The number of clicks in the last hour. */
@Getter @Setter
private Integer clicksLastHour;

/** The number of clicks in the last 24 hours. */
@Getter @Setter
private Integer clicksLastDay;

/** The number of languages. */
@Getter @Setter
private Integer languages;

/** The number of countries. */
@Getter @Setter
private Integer countries;

}

0 comments on commit 51bcdc7

Please sign in to comment.