├── src └── main │ └── java │ └── ru │ └── blizzed │ └── discogsdb │ ├── model │ ├── Currency.java │ ├── Error.java │ ├── Page.java │ ├── Type.java │ ├── release │ │ ├── UserReleaseRating.java │ │ ├── Identifier.java │ │ ├── Rating.java │ │ ├── Submitter.java │ │ ├── Contributor.java │ │ ├── Format.java │ │ ├── Track.java │ │ ├── Video.java │ │ ├── Label.java │ │ ├── Company.java │ │ ├── ExtraArtist.java │ │ ├── SimpleArtist.java │ │ ├── Community.java │ │ ├── Version.java │ │ ├── MasterRelease.java │ │ └── Release.java │ ├── CommunityReleaseRating.java │ ├── artist │ │ ├── Member.java │ │ ├── Artist.java │ │ └── ArtistRelease.java │ ├── search │ │ ├── BaseSearchResult.java │ │ └── ReleaseSearchResult.java │ ├── Image.java │ ├── label │ │ ├── LabelRelease.java │ │ └── Label.java │ ├── PaginatedResult.java │ └── SearchPage.java │ ├── params │ ├── TypeParam.java │ ├── SortParam.java │ ├── SortOrderParam.java │ ├── EnumParam.java │ ├── ParamsConverter.java │ ├── DiscogsDBParams.java │ └── Param.java │ ├── DiscogsDBCallException.java │ ├── DiscogsDBErrorException.java │ ├── DiscogsAuthData.java │ ├── DiscogsDBCaller.java │ ├── DiscogsDBApiCaller.java │ └── DiscogsDBApi.java ├── README.md └── pom.xml /src/main/java/ru/blizzed/discogsdb/model/Currency.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model; 18 | 19 | public enum Currency { 20 | USD, GBP, EUR, CAD, AUD, JPY, CHF, MXN, BRL, NZD, SEK, ZAR 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/Error.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model; 18 | 19 | public class Error { 20 | 21 | private String message; 22 | 23 | public String getMessage() { 24 | return message; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/params/TypeParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.params; 18 | 19 | import ru.blizzed.discogsdb.model.Type; 20 | 21 | public class TypeParam extends EnumParam { 22 | 23 | public TypeParam() { 24 | super("type"); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/params/SortParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.params; 18 | 19 | public class SortParam extends EnumParam { 20 | 21 | public enum Type { 22 | YEAR, TITLE, FORMAT 23 | } 24 | 25 | public SortParam() { 26 | super("sort"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/params/SortOrderParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.params; 18 | 19 | public class SortOrderParam extends EnumParam { 20 | 21 | public enum Type { 22 | DESC, ASC 23 | } 24 | 25 | public SortOrderParam() { 26 | super("sort_order"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/params/EnumParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.params; 18 | 19 | public class EnumParam extends Param { 20 | 21 | public EnumParam(String name) { 22 | super(name); 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return super.toString().toLowerCase(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/DiscogsDBCallException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * This exception can be thrown when call to API cannot be established 23 | * 24 | * @author BlizzedRu 25 | */ 26 | public class DiscogsDBCallException extends IOException { 27 | 28 | public DiscogsDBCallException(Throwable cause) { 29 | super(cause); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/Page.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | import java.util.List; 22 | 23 | public class Page extends PaginatedResult { 24 | 25 | @SerializedName(value = "release", alternate = {"results", "versions", "releases"}) 26 | private List content; 27 | 28 | public List getContent() { 29 | return content; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/Type.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | public enum Type { 22 | @SerializedName("release") 23 | RELEASE, 24 | 25 | @SerializedName("master") 26 | MASTER, 27 | 28 | @SerializedName("artist") 29 | ARTIST, 30 | 31 | @SerializedName("label") 32 | LABEL; 33 | 34 | public String lower() { 35 | return name().toLowerCase(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/UserReleaseRating.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model.release; 18 | 19 | public class UserReleaseRating { 20 | 21 | private String username; 22 | private long release; 23 | private int rating; 24 | 25 | public String getUsername() { 26 | return username; 27 | } 28 | 29 | public long getRelease() { 30 | return release; 31 | } 32 | 33 | public int getRating() { 34 | return rating; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Identifier.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Identifier { 23 | 24 | @SerializedName("type") 25 | private String type; 26 | 27 | @SerializedName("value") 28 | private String value; 29 | 30 | public String getType() { 31 | return type; 32 | } 33 | 34 | public String getValue() { 35 | return value; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Rating.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Rating { 23 | 24 | @SerializedName("average") 25 | private double average; 26 | 27 | @SerializedName("count") 28 | private int count; 29 | 30 | public double getAverage() { 31 | return average; 32 | } 33 | 34 | public int getCount() { 35 | return count; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Submitter.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Submitter { 23 | 24 | @SerializedName("resource_url") 25 | private String resourceUrl; 26 | 27 | @SerializedName("username") 28 | private String username; 29 | 30 | public String getResourceUrl() { 31 | return resourceUrl; 32 | } 33 | 34 | public String getUsername() { 35 | return username; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/CommunityReleaseRating.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | import ru.blizzed.discogsdb.model.release.Rating; 21 | 22 | public class CommunityReleaseRating { 23 | 24 | private Rating rating; 25 | 26 | @SerializedName("release_id") 27 | private long releaseId; 28 | 29 | public Rating getRating() { 30 | return rating; 31 | } 32 | 33 | public long getReleaseId() { 34 | return releaseId; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Contributor.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Contributor { 23 | 24 | @SerializedName("resource_url") 25 | private String resourceUrl; 26 | 27 | @SerializedName("username") 28 | private String username; 29 | 30 | public String getResourceUrl() { 31 | return resourceUrl; 32 | } 33 | 34 | public String getUsername() { 35 | return username; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/DiscogsDBErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb; 18 | 19 | import ru.blizzed.discogsdb.model.Error; 20 | 21 | /** 22 | * This exception can be thrown when API has been called but response contains an error 23 | * 24 | * @author BlizzedRu 25 | */ 26 | public class DiscogsDBErrorException extends Exception { 27 | 28 | private Error error; 29 | 30 | public DiscogsDBErrorException(Error error) { 31 | this.error = error; 32 | } 33 | 34 | public Error getError() { 35 | return error; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/params/ParamsConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.params; 18 | 19 | import java.util.Arrays; 20 | import java.util.Collections; 21 | import java.util.LinkedHashMap; 22 | import java.util.Map; 23 | 24 | public class ParamsConverter { 25 | 26 | public static Map asMap(Param... params) { 27 | if (params == null) return Collections.emptyMap(); 28 | Map map = new LinkedHashMap<>(); 29 | Arrays.stream(params).forEach(p -> map.put(p.name(), p.toString())); 30 | return map; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Format.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | import java.util.List; 23 | 24 | public class Format { 25 | 26 | @SerializedName("descriptions") 27 | private List descriptions; 28 | 29 | @SerializedName("name") 30 | private String name; 31 | 32 | @SerializedName("qty") 33 | private String qty; 34 | 35 | public List getDescriptions() { 36 | return descriptions; 37 | } 38 | 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | public String getQty() { 44 | return qty; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/artist/Member.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model.artist; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | public class Member { 22 | 23 | @SerializedName("active") 24 | private boolean active; 25 | 26 | @SerializedName("id") 27 | private long id; 28 | 29 | @SerializedName("name") 30 | private String name; 31 | 32 | @SerializedName("resource_url") 33 | private String resourceUrl; 34 | 35 | public boolean isActive() { 36 | return active; 37 | } 38 | 39 | public long getId() { 40 | return id; 41 | } 42 | 43 | public String getName() { 44 | return name; 45 | } 46 | 47 | public String getResourceUrl() { 48 | return resourceUrl; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Track.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Track { 23 | 24 | @SerializedName("duration") 25 | private String duration; 26 | 27 | @SerializedName("position") 28 | private String position; 29 | 30 | @SerializedName("title") 31 | private String title; 32 | 33 | @SerializedName("type_") 34 | private String type; 35 | 36 | public String getDuration() { 37 | return duration; 38 | } 39 | 40 | public String getPosition() { 41 | return position; 42 | } 43 | 44 | public String getTitle() { 45 | return title; 46 | } 47 | 48 | public String getType() { 49 | return type; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/DiscogsAuthData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb; 18 | 19 | public class DiscogsAuthData { 20 | private String consumerKey; 21 | private String consumerSecret; 22 | 23 | public DiscogsAuthData(String consumerKey, String consumerSecret) { 24 | this.consumerKey = consumerKey; 25 | this.consumerSecret = consumerSecret; 26 | } 27 | 28 | public String getConsumerKey() { 29 | return consumerKey; 30 | } 31 | 32 | public void setConsumerKey(String consumerKey) { 33 | this.consumerKey = consumerKey; 34 | } 35 | 36 | public String getConsumerSecret() { 37 | return consumerSecret; 38 | } 39 | 40 | public void setConsumerSecret(String consumerSecret) { 41 | this.consumerSecret = consumerSecret; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Video.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Video { 23 | 24 | @SerializedName("description") 25 | private String description; 26 | 27 | @SerializedName("duration") 28 | private int duration; 29 | 30 | @SerializedName("embed") 31 | private Boolean embed; 32 | 33 | @SerializedName("title") 34 | private String title; 35 | 36 | @SerializedName("uri") 37 | private String uri; 38 | 39 | public String getDescription() { 40 | return description; 41 | } 42 | 43 | public int getDuration() { 44 | return duration; 45 | } 46 | 47 | public Boolean getEmbed() { 48 | return embed; 49 | } 50 | 51 | public String getTitle() { 52 | return title; 53 | } 54 | 55 | public String getUri() { 56 | return uri; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Label.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Label { 23 | 24 | @SerializedName("catno") 25 | private String catNo; 26 | 27 | @SerializedName("entity_type") 28 | private String entityType; 29 | 30 | @SerializedName("id") 31 | private long id; 32 | 33 | @SerializedName("name") 34 | private String name; 35 | 36 | @SerializedName("resource_url") 37 | private String resourceUrl; 38 | 39 | public String getCatNo() { 40 | return catNo; 41 | } 42 | 43 | public String getEntityType() { 44 | return entityType; 45 | } 46 | 47 | public long getId() { 48 | return id; 49 | } 50 | 51 | public String getName() { 52 | return name; 53 | } 54 | 55 | public String getResourceUrl() { 56 | return resourceUrl; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/search/BaseSearchResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model.search; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | import ru.blizzed.discogsdb.model.Type; 21 | 22 | public class BaseSearchResult { 23 | 24 | @SerializedName("thumb") 25 | private String thumbnail; 26 | 27 | private String title; 28 | 29 | private String uri; 30 | 31 | @SerializedName("resource_url") 32 | private String resourceUrl; 33 | 34 | private long id; 35 | 36 | private Type type; 37 | 38 | public String getThumbnail() { 39 | return thumbnail; 40 | } 41 | 42 | public String getTitle() { 43 | return title; 44 | } 45 | 46 | public String getUri() { 47 | return uri; 48 | } 49 | 50 | public String getResourceUrl() { 51 | return resourceUrl; 52 | } 53 | 54 | public long getId() { 55 | return id; 56 | } 57 | 58 | public Type getType() { 59 | return type; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/Image.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Image { 23 | 24 | @SerializedName("height") 25 | private int height; 26 | 27 | @SerializedName("resource_url") 28 | private String resourceUrl; 29 | 30 | @SerializedName("type") 31 | private String type; 32 | 33 | @SerializedName("uri") 34 | private String uri; 35 | 36 | @SerializedName("uri150") 37 | private String uri150; 38 | 39 | @SerializedName("width") 40 | private int width; 41 | 42 | public int getHeight() { 43 | return height; 44 | } 45 | 46 | public String getResourceUrl() { 47 | return resourceUrl; 48 | } 49 | 50 | public String getType() { 51 | return type; 52 | } 53 | 54 | public String getUri() { 55 | return uri; 56 | } 57 | 58 | public String getUri150() { 59 | return uri150; 60 | } 61 | 62 | public int getWidth() { 63 | return width; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Company.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class Company { 23 | 24 | @SerializedName("catno") 25 | private String catNo; 26 | 27 | @SerializedName("entity_type") 28 | private String entityType; 29 | 30 | @SerializedName("entity_type_name") 31 | private String entityTypeName; 32 | 33 | @SerializedName("id") 34 | private long id; 35 | 36 | @SerializedName("name") 37 | private String name; 38 | 39 | @SerializedName("resource_url") 40 | private String resourceUrl; 41 | 42 | public String getCatNo() { 43 | return catNo; 44 | } 45 | 46 | public String getEntityType() { 47 | return entityType; 48 | } 49 | 50 | public String getEntityTypeName() { 51 | return entityTypeName; 52 | } 53 | 54 | public long getId() { 55 | return id; 56 | } 57 | 58 | public String getName() { 59 | return name; 60 | } 61 | 62 | public String getResourceUrl() { 63 | return resourceUrl; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/ExtraArtist.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class ExtraArtist { 23 | 24 | @SerializedName("anv") 25 | private String anv; 26 | 27 | @SerializedName("id") 28 | private long id; 29 | 30 | @SerializedName("join") 31 | private String join; 32 | 33 | @SerializedName("name") 34 | private String name; 35 | 36 | @SerializedName("resource_url") 37 | private String resourceUrl; 38 | 39 | @SerializedName("role") 40 | private String role; 41 | 42 | @SerializedName("tracks") 43 | private String tracks; 44 | 45 | public String getAnv() { 46 | return anv; 47 | } 48 | 49 | public long getId() { 50 | return id; 51 | } 52 | 53 | public String getJoin() { 54 | return join; 55 | } 56 | 57 | public String getName() { 58 | return name; 59 | } 60 | 61 | public String getResourceUrl() { 62 | return resourceUrl; 63 | } 64 | 65 | public String getRole() { 66 | return role; 67 | } 68 | 69 | public String getTracks() { 70 | return tracks; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/SimpleArtist.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | public class SimpleArtist { 23 | 24 | @SerializedName("anv") 25 | private String anv; 26 | 27 | @SerializedName("id") 28 | private long id; 29 | 30 | @SerializedName("join") 31 | private String join; 32 | 33 | @SerializedName("name") 34 | private String name; 35 | 36 | @SerializedName("resource_url") 37 | private String resourceUrl; 38 | 39 | @SerializedName("role") 40 | private String role; 41 | 42 | @SerializedName("tracks") 43 | private String tracks; 44 | 45 | public String getAnv() { 46 | return anv; 47 | } 48 | 49 | public long getId() { 50 | return id; 51 | } 52 | 53 | public String getJoin() { 54 | return join; 55 | } 56 | 57 | public String getName() { 58 | return name; 59 | } 60 | 61 | public String getResourceUrl() { 62 | return resourceUrl; 63 | } 64 | 65 | public String getRole() { 66 | return role; 67 | } 68 | 69 | public String getTracks() { 70 | return tracks; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Community.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | import com.google.gson.annotations.SerializedName; 21 | 22 | import java.util.List; 23 | 24 | public class Community { 25 | 26 | @SerializedName("contributors") 27 | private List contributors; 28 | 29 | @SerializedName("data_quality") 30 | private String dataQuality; 31 | 32 | @SerializedName("have") 33 | private long have; 34 | 35 | @SerializedName("rating") 36 | private Rating rating; 37 | 38 | @SerializedName("status") 39 | private String status; 40 | 41 | @SerializedName("submitter") 42 | private Submitter submitter; 43 | 44 | @SerializedName("want") 45 | private int want; 46 | 47 | public List getContributors() { 48 | return contributors; 49 | } 50 | 51 | public String getDataQuality() { 52 | return dataQuality; 53 | } 54 | 55 | public long getHave() { 56 | return have; 57 | } 58 | 59 | public Rating getRating() { 60 | return rating; 61 | } 62 | 63 | public String getStatus() { 64 | return status; 65 | } 66 | 67 | public Submitter getSubmitter() { 68 | return submitter; 69 | } 70 | 71 | public int getWant() { 72 | return want; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/label/LabelRelease.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model.label; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | public class LabelRelease { 22 | 23 | @SerializedName("artist") 24 | private String artist; 25 | 26 | @SerializedName("catno") 27 | private String catNo; 28 | 29 | @SerializedName("format") 30 | private String format; 31 | 32 | @SerializedName("id") 33 | private long id; 34 | 35 | @SerializedName("resource_url") 36 | private String resourceUrl; 37 | 38 | @SerializedName("status") 39 | private String status; 40 | 41 | @SerializedName("thumb") 42 | private String thumb; 43 | 44 | @SerializedName("title") 45 | private String title; 46 | 47 | @SerializedName("year") 48 | private int year; 49 | 50 | public String getArtist() { 51 | return artist; 52 | } 53 | 54 | public String getCatNo() { 55 | return catNo; 56 | } 57 | 58 | public String getFormat() { 59 | return format; 60 | } 61 | 62 | public long getId() { 63 | return id; 64 | } 65 | 66 | public String getResourceUrl() { 67 | return resourceUrl; 68 | } 69 | 70 | public String getStatus() { 71 | return status; 72 | } 73 | 74 | public String getThumb() { 75 | return thumb; 76 | } 77 | 78 | public String getTitle() { 79 | return title; 80 | } 81 | 82 | public int getYear() { 83 | return year; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/PaginatedResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | public class PaginatedResult { 22 | 23 | private Pagination pagination; 24 | 25 | public Pagination getPagination() { 26 | return pagination; 27 | } 28 | 29 | public static class Pagination { 30 | 31 | @SerializedName("per_page") 32 | private int perPage; 33 | 34 | @SerializedName(value = "itemsCount", alternate = "items") 35 | private int itemsCount; 36 | 37 | @SerializedName("page") 38 | private int page; 39 | 40 | @SerializedName("urls") 41 | private Urls urls; 42 | 43 | @SerializedName(value = "pagesCount", alternate = "pages") 44 | private int pagesCount; 45 | 46 | public int getPerPage() { 47 | return perPage; 48 | } 49 | 50 | public int getItemsCount() { 51 | return itemsCount; 52 | } 53 | 54 | public int getPage() { 55 | return page; 56 | } 57 | 58 | public Urls getUrls() { 59 | return urls; 60 | } 61 | 62 | public int getPagesCount() { 63 | return pagesCount; 64 | } 65 | 66 | public static class Urls { 67 | private String last; 68 | private String next; 69 | 70 | public String getLast() { 71 | return last; 72 | } 73 | 74 | public String getNext() { 75 | return next; 76 | } 77 | } 78 | 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/search/ReleaseSearchResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model.search; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | import java.util.List; 22 | 23 | public class ReleaseSearchResult extends BaseSearchResult { 24 | 25 | @SerializedName("style") 26 | private List styles; 27 | 28 | @SerializedName("format") 29 | private List formats; 30 | 31 | private String country; 32 | 33 | @SerializedName("barcode") 34 | private List barcodes; 35 | 36 | @SerializedName("label") 37 | private List labels; 38 | 39 | @SerializedName("catno") 40 | private String catNo; 41 | 42 | private Integer year; 43 | 44 | @SerializedName("genre") 45 | private List genres; 46 | 47 | private Community community; 48 | 49 | public List getStyles() { 50 | return styles; 51 | } 52 | 53 | public List getFormats() { 54 | return formats; 55 | } 56 | 57 | public String getCountry() { 58 | return country; 59 | } 60 | 61 | public List getBarcodes() { 62 | return barcodes; 63 | } 64 | 65 | public List getLabels() { 66 | return labels; 67 | } 68 | 69 | public String getCatNo() { 70 | return catNo; 71 | } 72 | 73 | public Integer getYear() { 74 | return year; 75 | } 76 | 77 | public List getGenres() { 78 | return genres; 79 | } 80 | 81 | public static class Community { 82 | private int want; 83 | private int have; 84 | 85 | public int getWant() { 86 | return want; 87 | } 88 | 89 | public int getHave() { 90 | return have; 91 | } 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/artist/Artist.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model.artist; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | import ru.blizzed.discogsdb.model.Image; 21 | 22 | import java.util.List; 23 | 24 | public class Artist { 25 | 26 | @SerializedName("namevariations") 27 | private List nameVariations; 28 | 29 | @SerializedName("profile") 30 | private String profile; 31 | 32 | @SerializedName("releases_url") 33 | private String releasesUrl; 34 | 35 | @SerializedName("resource_url") 36 | private String resourceUrl; 37 | 38 | @SerializedName("uri") 39 | private String uri; 40 | 41 | @SerializedName("urls") 42 | private List urls; 43 | 44 | @SerializedName("data_quality") 45 | private String dataQuality; 46 | 47 | @SerializedName("id") 48 | private long id; 49 | 50 | @SerializedName("images") 51 | private List images; 52 | 53 | @SerializedName("members") 54 | private List members; 55 | 56 | public List getNameVariations() { 57 | return nameVariations; 58 | } 59 | 60 | public String getProfile() { 61 | return profile; 62 | } 63 | 64 | public String getReleasesUrl() { 65 | return releasesUrl; 66 | } 67 | 68 | public String getResourceUrl() { 69 | return resourceUrl; 70 | } 71 | 72 | public String getUri() { 73 | return uri; 74 | } 75 | 76 | public List getUrls() { 77 | return urls; 78 | } 79 | 80 | public String getDataQuality() { 81 | return dataQuality; 82 | } 83 | 84 | public long getId() { 85 | return id; 86 | } 87 | 88 | public List getImages() { 89 | return images; 90 | } 91 | 92 | public List getMembers() { 93 | return members; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/params/DiscogsDBParams.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.params; 18 | 19 | /** 20 | * Common parameters for DiscogsBD API methods 21 | * 22 | * @author BlizzedRu 23 | */ 24 | public final class DiscogsDBParams { 25 | 26 | private DiscogsDBParams() { 27 | } 28 | 29 | public static final Param PAGE = new Param<>("page"); 30 | public static final Param PER_PAGE = new Param<>("per_page"); 31 | public static final SortParam SORT = new SortParam(); 32 | public static final SortOrderParam SORT_ORDER = new SortOrderParam(); 33 | public static final TypeParam TYPE = new TypeParam(); 34 | public static final Param TITLE = new Param<>("title"); 35 | public static final Param RELEASE_TITLE = new Param<>("release_title"); 36 | public static final Param CREDIT = new Param<>("credit"); 37 | public static final Param ARTIST = new Param<>("artist"); 38 | public static final Param ANV = new Param<>("anv"); 39 | public static final Param LABEL = new Param<>("label"); 40 | public static final Param GENRE = new Param<>("genre"); 41 | public static final Param STYLE = new Param<>("style"); 42 | public static final Param COUNTRY = new Param<>("country"); 43 | public static final Param YEAR = new Param<>("year"); 44 | public static final Param FORMAT = new Param<>("format"); 45 | public static final Param CAT_NO = new Param<>("catno"); 46 | public static final Param BARCODE = new Param<>("barcode"); 47 | public static final Param TRACK = new Param<>("track"); 48 | public static final Param SUBMITTER = new Param<>("submitter"); 49 | public static final Param CONTRIBUTOR = new Param<>("contributor"); 50 | public static final Param QUERY = new Param<>("q"); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/artist/ArtistRelease.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model.artist; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | public class ArtistRelease { 22 | 23 | @SerializedName("artist") 24 | private String artist; 25 | 26 | @SerializedName("id") 27 | private long id; 28 | 29 | @SerializedName("main_release") 30 | private long mainRelease; 31 | 32 | @SerializedName("resource_url") 33 | private String resourceUrl; 34 | 35 | @SerializedName("role") 36 | private String role; 37 | 38 | @SerializedName("thumb") 39 | private String thumb; 40 | 41 | @SerializedName("title") 42 | private String title; 43 | 44 | @SerializedName("type") 45 | private String type; 46 | 47 | @SerializedName("year") 48 | private int year; 49 | 50 | @SerializedName("format") 51 | private String format; 52 | 53 | @SerializedName("label") 54 | private String label; 55 | 56 | @SerializedName("status") 57 | private String status; 58 | 59 | public String getArtist() { 60 | return artist; 61 | } 62 | 63 | public long getId() { 64 | return id; 65 | } 66 | 67 | public long getMainRelease() { 68 | return mainRelease; 69 | } 70 | 71 | public String getResourceUrl() { 72 | return resourceUrl; 73 | } 74 | 75 | public String getRole() { 76 | return role; 77 | } 78 | 79 | public String getThumb() { 80 | return thumb; 81 | } 82 | 83 | public String getTitle() { 84 | return title; 85 | } 86 | 87 | public String getType() { 88 | return type; 89 | } 90 | 91 | public int getYear() { 92 | return year; 93 | } 94 | 95 | public String getFormat() { 96 | return format; 97 | } 98 | 99 | public String getLabel() { 100 | return label; 101 | } 102 | 103 | public String getStatus() { 104 | return status; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/params/Param.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.params; 18 | 19 | import java.util.Arrays; 20 | import java.util.Objects; 21 | 22 | /** 23 | * A wrapper key-datatype class for params. 24 | * 25 | * @param type that param expects 26 | * @author BlizzedRu 27 | */ 28 | public class Param implements Cloneable { 29 | 30 | private String name; 31 | protected DataType[] data; 32 | 33 | public Param(String name) { 34 | this.name = name; 35 | } 36 | 37 | public String name() { 38 | return name; 39 | } 40 | 41 | @SafeVarargs 42 | public final Param of(DataType... data) { 43 | Param param; 44 | try { 45 | param = clone(); 46 | } catch (CloneNotSupportedException e) { 47 | param = new Param<>(name); 48 | } 49 | param.data = data; 50 | return param; 51 | } 52 | 53 | public DataType[] getData() { 54 | return data; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | if (data == null || data.length == 0) return ""; 60 | StringBuilder sb = new StringBuilder(); 61 | Arrays.stream(data).forEach(d -> sb.append(d.toString().toLowerCase()).append(",")); 62 | return sb.deleteCharAt(sb.length() - 1).toString(); 63 | } 64 | 65 | /** 66 | * Returns result of comparison this {@link Param} and another {@link Object}. 67 | *

true is always when o is a {@link Param} and has the same name 68 | * 69 | * @param o another object 70 | * @return result of comparison 71 | */ 72 | @Override 73 | public boolean equals(Object o) { 74 | if (this == o) return true; 75 | if (o == null || getClass() != o.getClass()) return false; 76 | Param param = (Param) o; 77 | return Objects.equals(name, param.name); 78 | } 79 | 80 | @Override 81 | public int hashCode() { 82 | return Objects.hash(name); 83 | } 84 | 85 | @SuppressWarnings("unchecked") 86 | @Override 87 | protected Param clone() throws CloneNotSupportedException { 88 | return (Param) super.clone(); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/DiscogsDBCaller.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb; 18 | 19 | import retrofit2.Call; 20 | import retrofit2.Callback; 21 | import retrofit2.Response; 22 | import ru.blizzed.discogsdb.model.Error; 23 | 24 | import java.io.IOException; 25 | 26 | public final class DiscogsDBCaller { 27 | 28 | public interface Listener { 29 | default void onComplete(ResultType result, DiscogsDBCaller discogsDBCaller) { 30 | } 31 | 32 | default void onError(Error error, DiscogsDBCaller discogsDBCaller) { 33 | } 34 | 35 | default void onFailure(DiscogsDBCallException e, DiscogsDBCaller discogsDBCaller) { 36 | } 37 | } 38 | 39 | private Call call; 40 | 41 | public DiscogsDBCaller(Call call) { 42 | this.call = call; 43 | } 44 | 45 | public ResultType execute() throws DiscogsDBCallException, DiscogsDBErrorException { 46 | try { 47 | Response response = call.execute(); 48 | if (response.isSuccessful()) 49 | return response.body(); 50 | else throw new DiscogsDBErrorException(parseError(response)); 51 | } catch (IOException e) { 52 | throw new DiscogsDBCallException(e); 53 | } 54 | } 55 | 56 | public void execute(Listener listener) { 57 | call.enqueue(new Callback() { 58 | @Override 59 | public void onResponse(Call call, Response response) { 60 | if (response.isSuccessful()) listener.onComplete(response.body(), DiscogsDBCaller.this); 61 | else { 62 | try { 63 | listener.onError(parseError(response), DiscogsDBCaller.this); 64 | } catch (IOException e) { 65 | listener.onFailure(new DiscogsDBCallException(e), DiscogsDBCaller.this); 66 | } 67 | } 68 | } 69 | 70 | @Override 71 | public void onFailure(Call call, Throwable throwable) { 72 | listener.onFailure(new DiscogsDBCallException(throwable), DiscogsDBCaller.this); 73 | } 74 | }); 75 | } 76 | 77 | public void cancel() { 78 | if (!call.isCanceled() & !call.isExecuted()) 79 | call.cancel(); 80 | } 81 | 82 | private Error parseError(Response response) throws IOException { 83 | return DiscogsDBApi.getInstance().parseError(response.errorBody()); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/label/Label.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model.label; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | import ru.blizzed.discogsdb.model.Image; 21 | 22 | import java.util.List; 23 | 24 | public class Label { 25 | 26 | @SerializedName("profile") 27 | private String profile; 28 | 29 | @SerializedName("releases_url") 30 | private String releasesUrl; 31 | 32 | @SerializedName("name") 33 | private String name; 34 | 35 | @SerializedName("contact_info") 36 | private String contactInfo; 37 | 38 | @SerializedName("uri") 39 | private String uri; 40 | 41 | @SerializedName("sublabels") 42 | private List subLabels; 43 | 44 | @SerializedName("urls") 45 | private List urls; 46 | 47 | @SerializedName("images") 48 | private List images; 49 | 50 | @SerializedName("resource_url") 51 | private String resourceUrl; 52 | 53 | @SerializedName("id") 54 | private int id; 55 | 56 | @SerializedName("data_quality") 57 | private String dataQuality; 58 | 59 | public String getProfile() { 60 | return profile; 61 | } 62 | 63 | public String getReleasesUrl() { 64 | return releasesUrl; 65 | } 66 | 67 | public String getName() { 68 | return name; 69 | } 70 | 71 | public String getContactInfo() { 72 | return contactInfo; 73 | } 74 | 75 | public String getUri() { 76 | return uri; 77 | } 78 | 79 | public List getSubLabels() { 80 | return subLabels; 81 | } 82 | 83 | public List getUrls() { 84 | return urls; 85 | } 86 | 87 | public List getImages() { 88 | return images; 89 | } 90 | 91 | public String getResourceUrl() { 92 | return resourceUrl; 93 | } 94 | 95 | public int getId() { 96 | return id; 97 | } 98 | 99 | public String getDataQuality() { 100 | return dataQuality; 101 | } 102 | 103 | public static class SubLabel { 104 | 105 | @SerializedName("resource_url") 106 | private String resourceUrl; 107 | 108 | @SerializedName("id") 109 | private long id; 110 | 111 | @SerializedName("name") 112 | private String name; 113 | 114 | public String getResourceUrl() { 115 | return resourceUrl; 116 | } 117 | 118 | public long getId() { 119 | return id; 120 | } 121 | 122 | public String getName() { 123 | return name; 124 | } 125 | } 126 | 127 | } 128 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ru.blizzed.discogsdb.model.release; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | import java.util.List; 22 | 23 | public class Version { 24 | 25 | @SerializedName("catno") 26 | private String catNo; 27 | 28 | private String country; 29 | 30 | private String format; 31 | 32 | private long id; 33 | 34 | private String label; 35 | 36 | private String released; 37 | 38 | @SerializedName("resource_url") 39 | private String resourceUrl; 40 | 41 | private String status; 42 | 43 | @SerializedName("major_formats") 44 | private List majorFormats; 45 | 46 | @SerializedName("thumb") 47 | private String thumbnail; 48 | 49 | private String title; 50 | 51 | public String getCatNo() { 52 | return catNo; 53 | } 54 | 55 | public void setCatNo(String catNo) { 56 | this.catNo = catNo; 57 | } 58 | 59 | public String getCountry() { 60 | return country; 61 | } 62 | 63 | public void setCountry(String country) { 64 | this.country = country; 65 | } 66 | 67 | public String getFormat() { 68 | return format; 69 | } 70 | 71 | public void setFormat(String format) { 72 | this.format = format; 73 | } 74 | 75 | public long getId() { 76 | return id; 77 | } 78 | 79 | public void setId(long id) { 80 | this.id = id; 81 | } 82 | 83 | public String getLabel() { 84 | return label; 85 | } 86 | 87 | public void setLabel(String label) { 88 | this.label = label; 89 | } 90 | 91 | public String getReleased() { 92 | return released; 93 | } 94 | 95 | public void setReleased(String released) { 96 | this.released = released; 97 | } 98 | 99 | public String getResourceUrl() { 100 | return resourceUrl; 101 | } 102 | 103 | public void setResourceUrl(String resourceUrl) { 104 | this.resourceUrl = resourceUrl; 105 | } 106 | 107 | public String getStatus() { 108 | return status; 109 | } 110 | 111 | public void setStatus(String status) { 112 | this.status = status; 113 | } 114 | 115 | public List getMajorFormats() { 116 | return majorFormats; 117 | } 118 | 119 | public void setMajorFormats(List majorFormats) { 120 | this.majorFormats = majorFormats; 121 | } 122 | 123 | public String getThumbnail() { 124 | return thumbnail; 125 | } 126 | 127 | public void setThumbnail(String thumbnail) { 128 | this.thumbnail = thumbnail; 129 | } 130 | 131 | public String getTitle() { 132 | return title; 133 | } 134 | 135 | public void setTitle(String title) { 136 | this.title = title; 137 | } 138 | 139 | } 140 | -------------------------------------------------------------------------------- /src/main/java/ru/blizzed/discogsdb/model/release/MasterRelease.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2017 BlizzedRu (Ivan Vlasov) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package ru.blizzed.discogsdb.model.release; 19 | 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | import ru.blizzed.discogsdb.model.Image; 23 | 24 | import java.util.List; 25 | 26 | 27 | public class MasterRelease { 28 | 29 | @SerializedName("styles") 30 | private List styles; 31 | 32 | @SerializedName("genres") 33 | private List genres; 34 | 35 | @SerializedName("videos") 36 | private List