Skip to content

Package: PhotoItem

PhotoItem

nameinstructionbranchcomplexitylinemethod
PhotoItem(MediaFolder, String, String)
M: 0 C: 24
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getAudioFile()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getId()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getMetadata()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getParent()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getPath()
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTitle()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toDumpString()
M: 0 C: 22
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toString()
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * *********************************************************************************************************************
3: *
4: * blueMarine II: Semantic Media Centre
5: * http://tidalwave.it/projects/bluemarine2
6: *
7: * Copyright (C) 2015 - 2021 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *********************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
12: * the License. You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
17: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations under the License.
19: *
20: * *********************************************************************************************************************
21: *
22: * git clone https://bitbucket.org/tidalwave/bluemarine2-src
23: * git clone https://github.com/tidalwave-it/bluemarine2-src
24: *
25: * *********************************************************************************************************************
26: */
27: package it.tidalwave.bluemarine2.service.stoppingdown.impl;
28:
29: import javax.annotation.Nonnull;
30: import java.util.Optional;
31: import java.nio.file.Path;
32: import it.tidalwave.bluemarine2.model.MediaFolder;
33: import it.tidalwave.bluemarine2.model.MediaItem;
34: import it.tidalwave.bluemarine2.model.audio.AudioFile;
35: import it.tidalwave.bluemarine2.model.spi.EntityWithRoles;
36: import it.tidalwave.bluemarine2.model.spi.PathAwareEntity;
37: import lombok.Getter;
38: import lombok.RequiredArgsConstructor;
39: import lombok.ToString;
40:
41: /***********************************************************************************************************************
42: *
43: * At the moment there's no support for images in the Model.
44: *
45: * @author Fabrizio Giudici
46: *
47: **********************************************************************************************************************/
48: @RequiredArgsConstructor @ToString(doNotUseGetters = true)
49: public class PhotoItem extends EntityWithRoles implements MediaItem, PathAwareEntity
50: {
51: @Nonnull
52: private final MediaFolder parent;
53:
54: @Getter @Nonnull
55: private final String id;
56:
57: @Getter @Nonnull
58: private final String title;
59:
60: @Override @Nonnull
61: public Path getPath()
62: {
63: return parent.getPath().resolve(id);
64: }
65:
66: @Override @Nonnull
67: public Metadata getMetadata()
68: {
69: throw new UnsupportedOperationException("Not supported yet.");
70: }
71:
72: @Override @Nonnull
73: public AudioFile getAudioFile()
74: {
75: throw new UnsupportedOperationException("Not supported yet.");
76: }
77:
78: @Override @Nonnull
79: public Optional<PathAwareEntity> getParent()
80: {
81: return Optional.of(parent);
82: }
83:
84: @Override @Nonnull
85: public String toDumpString()
86: {
87: return String.format("PhotoItem(parent=%s, id=%s, title=%s)", parent.getPath().toString(), id, title);
88: }
89: }