Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Indexer
Commits
9c16b949
Commit
9c16b949
authored
Dec 28, 2020
by
Sviatoslav Nekhaienko
Browse files
refactoring
parent
f1cc808e
Changes
2
Hide whitespace changes
Inline
Side-by-side
indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/PropertiesProcessor.java
View file @
9c16b949
...
...
@@ -73,7 +73,7 @@ public class PropertiesProcessor {
return
Stream
.
empty
();
}
if
(
!
Objects
.
is
Null
(
schemaConverterConfig
.
getSpecialDefinitionsMap
().
get
(
definitionSubRef
)))
{
if
(
Objects
.
non
Null
(
schemaConverterConfig
.
getSpecialDefinitionsMap
().
get
(
definitionSubRef
)))
{
return
storageSchemaEntry
(
schemaConverterConfig
.
getSpecialDefinitionsMap
().
get
(
definitionSubRef
),
pathPrefix
);
}
...
...
@@ -103,13 +103,13 @@ public class PropertiesProcessor {
return
Stream
.
empty
();
}
if
(
!
Objects
.
is
Null
(
entry
.
getValue
().
getProperties
()))
{
if
(
Objects
.
non
Null
(
entry
.
getValue
().
getProperties
()))
{
PropertiesProcessor
propertiesProcessor
=
new
PropertiesProcessor
(
definitions
,
pathPrefixWithDot
+
entry
.
getKey
()
,
log
,
new
SchemaConverterPropertiesConfig
());
return
entry
.
getValue
().
getProperties
().
entrySet
().
stream
().
flatMap
(
propertiesProcessor:
:
processPropertyEntry
);
}
if
(
!
Objects
.
is
Null
(
entry
.
getValue
().
getRef
()))
{
if
(
Objects
.
non
Null
(
entry
.
getValue
().
getRef
()))
{
return
new
PropertiesProcessor
(
definitions
,
pathPrefixWithDot
+
entry
.
getKey
(),
log
,
new
SchemaConverterPropertiesConfig
())
.
processRef
(
entry
.
getValue
().
getRef
());
}
...
...
@@ -131,15 +131,15 @@ public class PropertiesProcessor {
Preconditions
.
checkNotNull
(
definitionProperty
,
"definitionProperty cannot be null"
);
String
pattern
=
definitionProperty
.
getPattern
();
String
itemsPattern
=
definitionProperty
.
getItems
()
!=
null
?
definitionProperty
.
getItems
().
getPattern
()
:
null
;
String
format
=
definitionProperty
.
getFormat
();
String
type
=
definitionProperty
.
getType
();
String
itemsType
=
definitionProperty
.
getItems
()
!=
null
?
definitionProperty
.
getItems
().
getType
()
:
null
;
String
itemsPattern
=
definitionProperty
.
get
Items
()
!=
null
?
definitionProperty
.
getItems
().
getPattern
()
:
null
;
String
type
=
definitionProperty
.
get
Type
()
;
return
!
Objects
.
is
Null
(
pattern
)
&&
pattern
.
startsWith
(
"^srn"
)
?
"link"
:
!
Objects
.
is
Null
(
itemsPattern
)
&&
itemsPattern
.
startsWith
(
"^srn"
)
?
"link"
:
!
Objects
.
is
Null
(
format
)
?
schemaConverterConfig
.
getPrimitiveTypesMap
().
getOrDefault
(
format
,
format
)
:
!
Objects
.
is
Null
(
itemsType
)
?
schemaConverterConfig
.
getPrimitiveTypesMap
().
getOrDefault
(
itemsType
,
itemsType
)
:
return
Objects
.
non
Null
(
pattern
)
&&
pattern
.
startsWith
(
"^srn"
)
?
"link"
:
Objects
.
non
Null
(
itemsPattern
)
&&
itemsPattern
.
startsWith
(
"^srn"
)
?
"link"
:
Objects
.
non
Null
(
format
)
?
schemaConverterConfig
.
getPrimitiveTypesMap
().
getOrDefault
(
format
,
format
)
:
Objects
.
non
Null
(
itemsType
)
?
schemaConverterConfig
.
getPrimitiveTypesMap
().
getOrDefault
(
itemsType
,
itemsType
)
:
schemaConverterConfig
.
getPrimitiveTypesMap
().
getOrDefault
(
type
,
type
);
}
}
indexer-core/src/main/java/org/opengroup/osdu/indexer/service/impl/SchemaProviderImpl.java
View file @
9c16b949
...
...
@@ -38,7 +38,6 @@ import java.nio.charset.StandardCharsets;
* Provides implementation of the client service that retrieves schemas from the Schema Service
*/
@Component
@Lazy
public
class
SchemaProviderImpl
implements
SchemaService
{
@Inject
private
JaxRsDpsLog
log
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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