build: change of package name

This commit is contained in:
antonio 2023-06-17 15:30:23 +02:00
parent 49afdbe4eb
commit b76a38cb30
274 changed files with 1981 additions and 2161 deletions

View file

@ -0,0 +1,9 @@
package com.cappielloantonio.tempo.subsonic.base
import com.cappielloantonio.tempo.subsonic.models.SubsonicResponse
import com.google.gson.annotations.SerializedName
class ApiResponse {
@SerializedName("subsonic-response")
var subsonicResponse: SubsonicResponse? = null
}

View file

@ -0,0 +1,59 @@
package com.cappielloantonio.tempo.subsonic.base;
import androidx.annotation.NonNull;
public class Version implements Comparable<Version> {
private static final String VERSION_PATTERN = "\\d+(\\.\\d+)*";
private final String versionString;
public static Version of(String versionString) {
return new Version(versionString);
}
private Version(String versionString) {
if (versionString == null || !versionString.matches(VERSION_PATTERN)) {
throw new IllegalArgumentException("Invalid version format");
}
this.versionString = versionString;
}
public String getVersionString() {
return versionString;
}
public boolean isLowerThan(Version version) {
return compareTo(version) < 0;
}
@Override
public int compareTo(Version that) {
if (that == null) {
return 1;
}
String[] thisParts = this.getVersionString().split("\\.");
String[] thatParts = that.getVersionString().split("\\.");
int length = Math.max(thisParts.length, thatParts.length);
for (int i = 0; i < length; i++) {
int thisPart = i < thisParts.length ? Integer.parseInt(thisParts[i]) : 0;
int thatPart = i < thatParts.length ? Integer.parseInt(thatParts[i]) : 0;
if (thisPart < thatPart) {
return -1;
}
if (thisPart > thatPart) {
return 1;
}
}
return 0;
}
@NonNull
@Override
public String toString() {
return versionString;
}
}