Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DDA
dda-wizard
Commits
1d2b268a
Commit
1d2b268a
authored
Jul 30, 2018
by
Gerrit Hübbers
🃏
Browse files
Rename package
parent
3fd59ad8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gesis/dda/publishing/domain/BundlesStreamSource.java
View file @
1d2b268a
package
org.gesis.dda.publishing.domain
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Stream
;
public
interface
BundlesStreamSource
{
Stream
<
Bundle
>
getBundlesStream
();
String
getReference
();
Set
<
Metadatum
>
getAllMetadata
(
String
scopedIdentifier
);
default
Set
<
Metadatum
>
getAllMetadata
(
String
scopedIdentifier
)
{
Set
<
Metadatum
>
result
;
String
bundleIdentifier
=
getReference
()
+
"@@"
+
scopedIdentifier
;
Optional
<
Bundle
>
bundleOptional
=
getBundlesStream
().
filter
(
b
->
bundleIdentifier
.
equals
(
b
.
getReference
()
)
).
findFirst
();
if
(
bundleOptional
.
isPresent
()
)
{
result
=
bundleOptional
.
get
().
getMetadata
();
}
else
{
result
=
null
;
}
return
result
;
};
}
src/
test
/java/org/gesis/dda/
transformer
/XmlBundles.java
→
src/
main
/java/org/gesis/dda/
publishing/domain/impl
/XmlBundles.java
View file @
1d2b268a
package
org.gesis.dda.
transformer
;
package
org.gesis.dda.
publishing.domain.impl
;
import
java.util.HashSet
;
import
java.util.Set
;
...
...
@@ -9,8 +9,6 @@ import javax.xml.bind.annotation.XmlRootElement;
import
org.gesis.dda.publishing.domain.Bundle
;
import
org.gesis.dda.publishing.domain.BundlesStreamSource
;
import
org.gesis.dda.publishing.domain.Metadatum
;
import
org.gesis.dda.publishing.domain.impl.XmlBundle
;
@XmlRootElement
(
name
=
"bundles"
)
public
class
XmlBundles
implements
BundlesStreamSource
{
...
...
@@ -36,10 +34,4 @@ public class XmlBundles implements BundlesStreamSource {
return
view
.
stream
();
}
@Override
public
Set
<
Metadatum
>
getAllMetadata
(
String
scopedIdentifier
)
{
// TODO Auto-generated method stub
return
null
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment