Class InfobaseReferences
- java.lang.Object
-
- com._1c.g5.v8.dt.platform.services.core.infobases.InfobaseReferences
-
public final class InfobaseReferences extends Object
Infobase references utility methods.- Restriction:
- This class is not intended to be sub-classed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<InfobaseReference>
asPlainList(Collection<Section> sections)
Return tree-structured section list as plain infobase references list.static List<Section>
asPlainListWithGroups(Collection<Section> sections)
Return tree-structured section list as plain infobase references list.static int
compare(Section section, Section other, SectionPresentationMode mode)
Compares two specifiedSection
values in terms of sections order, using the provided section presentationmode
.static boolean
contains(Collection<InfobaseReference> infobases, InfobaseReference candidate)
Returns, whether the provided infobase is contained inside the provided infobases collection.static boolean
equals(Section first, Section second)
Determines whether two possibly-null
infobase sections are equal.static <T extends Section>
TfindByUuid(UUID uuid, Collection<T> sections)
Finds an infobase section in the provided section collection by the provided sectionUUID
.static String
getAlias(InfobaseReference infobase)
Returns the infobase alias for provided infobase:DefAlias
for file infobases infobase server reference for server infobasesstatic List<String>
getGroupNames(Collection<Section> sections)
Returns a list of all group names from provided sections and its subsections.static List<String>
getInfobaseNames(Collection<Section> sections)
Returns a list of all infobase names of provided sections and its subsections.static String
getInfobasesPresentation(Collection<InfobaseReference> infobases)
Return a UI presentation for the collection of infobases.static List<String>
getNames(Collection<Section> sections)
Returns a list of all names of provided sections and its subsections.static boolean
isDesignable(InfobaseReference infobase)
Returns wheter the provided infobase may be configured with 1C:Enterprise Designer agent connection.static InfobaseReference
newFileInfobaseReference(String fileLocation)
Creates and returns model instance of infobase reference of file type located in the providedfileLocation
.static InfobaseReference
newServerInfobaseReference(String server, String reference)
Creates and returns model instance of infobase reference of server type located in the providedserver
and referenced withreference
.static InfobaseReference
newWebInfobaseReference(UUID id, URI infobaseUri)
Creates and returns model instance of infobase reference of web type with URL reference to providedURL
with the provided UUID.static InfobaseReference
newWebInfobaseReference(UUID id, URI infobaseUri, URI designerUri, String name, String platformVersion)
Creates and returns model instance of infobase reference of web type with URL reference to providedURL
with the provided settings.static boolean
notExists(InfobaseReference infobase)
Returns whether the provided infobase does not exist.static boolean
notWeb(InfobaseReference infobase)
Returns wheter the provided infobase has not a web type.static boolean
remove(Collection<InfobaseReference> infobases, InfobaseReference candidate)
Remove infobase from the infobase collection.
-
-
-
Method Detail
-
asPlainList
public static List<InfobaseReference> asPlainList(Collection<Section> sections)
Return tree-structured section list as plain infobase references list.- Parameters:
sections
- the tree-structured section collection, cannot benull
- Returns:
- a plain infobase references list, never
null
-
asPlainListWithGroups
public static List<Section> asPlainListWithGroups(Collection<Section> sections)
Return tree-structured section list as plain infobase references list.- Parameters:
sections
- the tree-structured section collection, cannot benull
- Returns:
- a plain infobase references list, never
null
-
compare
public static int compare(Section section, Section other, SectionPresentationMode mode)
Compares two specifiedSection
values in terms of sections order, using the provided section presentationmode
.- Parameters:
section
- the firstSection
to compare, cannot benull
other
- the secondSection
to compare, cannot benull
mode
- the mode of section presentation: as list or as tree, cannot benull
- Returns:
- the value
0
ifsection
has the same order asother
; a value less than0
ifsection
is less in order thanother
; and a value greater than0
ifsection
is numerically greater thanother
-
contains
public static boolean contains(Collection<InfobaseReference> infobases, InfobaseReference candidate)
Returns, whether the provided infobase is contained inside the provided infobases collection. Method usesInfobaseReferences.equals
instead of objects identity.- Parameters:
infobases
- the collection of infobases, cannot benull
candidate
- the infoabse to check containment for, cannot benull
- Returns:
- whether the provided infobase is contained inside the provided infobases collection
-
equals
public static boolean equals(Section first, Section second)
Determines whether two possibly-null
infobase sections are equal. Returns:true
iffirst
andsecond
are bothnull
.true
iffirst
andsecond
are both non-null
and they have sameUUID
.false
in all other situations.
- Parameters:
first
- the fist infobase section to check equality, cannot benull
second
- the second infobase section to check equality, cannot benull
- Returns:
- whether two possibly-
null
infobases are equal
-
findByUuid
public static <T extends Section> T findByUuid(UUID uuid, Collection<T> sections)
Finds an infobase section in the provided section collection by the provided sectionUUID
.- Parameters:
uuid
- theUUID
to find infobase reference with, cannot benull
sections
- a collection of sections to search in, cannot benull
- Returns:
- the section with the provided
UUID
if found, ornull
if not found
-
getAlias
public static String getAlias(InfobaseReference infobase)
Returns the infobase alias for provided infobase:DefAlias
for file infobases- infobase server reference for server infobases
- Parameters:
infobase
- the infobase to define alias for, file or server type, cannot benull
- Returns:
- the infobase alias, never
null
- Throws:
IllegalArgumentException
- if the provided infobase is not file or server
-
getGroupNames
public static List<String> getGroupNames(Collection<Section> sections)
Returns a list of all group names from provided sections and its subsections.- Parameters:
sections
- the section collection to iterate and get names, cannot benull
- Returns:
- a list of all group names, never
null
-
getInfobaseNames
public static List<String> getInfobaseNames(Collection<Section> sections)
Returns a list of all infobase names of provided sections and its subsections.- Parameters:
sections
- the section collection to iterate and get names, cannot benull
- Returns:
- a list of all names, never
null
-
getInfobasesPresentation
public static String getInfobasesPresentation(Collection<InfobaseReference> infobases)
Return a UI presentation for the collection of infobases. May be used to show probably-long collection of infobases.- Parameters:
infobases
- a collection of infobases, cannot benull
- Returns:
- the UI presentation, never
null
-
getNames
public static List<String> getNames(Collection<Section> sections)
Returns a list of all names of provided sections and its subsections.- Parameters:
sections
- the section collection to iterate and get names, cannot benull
- Returns:
- the list of all names, never
null
-
newFileInfobaseReference
public static InfobaseReference newFileInfobaseReference(String fileLocation)
Creates and returns model instance of infobase reference of file type located in the providedfileLocation
.- Parameters:
fileLocation
- the file system infobase location, cannot benull
- Returns:
- a file infobase referece, never
null
-
newServerInfobaseReference
public static InfobaseReference newServerInfobaseReference(String server, String reference)
Creates and returns model instance of infobase reference of server type located in the providedserver
and referenced withreference
.- Parameters:
server
- a server name, cannot benull
reference
- an infobase reference in this server, cannot benull
- Returns:
- a server infobase referece, never
null
-
newWebInfobaseReference
public static InfobaseReference newWebInfobaseReference(UUID id, URI infobaseUri)
Creates and returns model instance of infobase reference of web type with URL reference to providedURL
with the provided UUID.- Parameters:
id
- the id of the infobase, cannot benull
infobaseUri
- the infobase URL ornull
if none- Returns:
- a web infobase referece, never
null
-
newWebInfobaseReference
public static InfobaseReference newWebInfobaseReference(UUID id, URI infobaseUri, URI designerUri, String name, String platformVersion)
Creates and returns model instance of infobase reference of web type with URL reference to providedURL
with the provided settings.- Parameters:
id
- the id of the infobase, cannot benull
infobaseUri
- the infobase URL, cannot benull
designerUri
- the 1C:Enterprise designer agent URI, cannot benull
name
- the name of the infobase, cannot benull
platformVersion
- the infobase 1C:Enterprise platform version, cannot benull
- Returns:
- a web infobase referece, never
null
-
notExists
public static boolean notExists(InfobaseReference infobase)
Returns whether the provided infobase does not exist.- Parameters:
infobase
- the infobase to check existence form cannot benull
- Returns:
- whether the provided infobase does not exist
-
notWeb
public static boolean notWeb(InfobaseReference infobase)
Returns wheter the provided infobase has not a web type.- Returns:
- wheter the provided infobase has not a web type
-
isDesignable
public static boolean isDesignable(InfobaseReference infobase)
Returns wheter the provided infobase may be configured with 1C:Enterprise Designer agent connection.- Returns:
- wheter the provided infobase may be configured with 1C:Enterprise Designer agent connection
-
remove
public static boolean remove(Collection<InfobaseReference> infobases, InfobaseReference candidate)
Remove infobase from the infobase collection. Method usesInfobaseReferences.equals
instead of objects identity.- Parameters:
infobases
- a collection of infobases, cannot benull
candidate
- the infoabse to remove for, cannot benull
- Returns:
- whether infobase was actually removed
-
-