new SolarNodeImageInfo(id, sha256, contentLength, uncompressedSha256, uncompressedContentLength)
Constructor.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | a unique identifier for this image |
sha256 |
string | hex-encoded SHA-256 digest of the image content |
contentLength |
number | the content length of the image content, in bytes |
uncompressedSha256 |
string | a hex-encoded SHA-256 digest of the image contents when uncompressed |
uncompressedContentLength |
number | the size of the image contents when uncompressed, in bytes |
Members
-
<readonly> contentLength :number
-
The content length of the image content, in bytes.
Type:
- number
-
<readonly> id :string
-
A unique identifier for this image.
Type:
- string
-
<readonly> sha256 :string
-
A hex-encoded SHA-256 digest of the image content.
Type:
- string
-
<readonly> uncompressedContentLength :number
-
The size of the image contents when uncompressed, in bytes.
Type:
- number
-
<readonly> uncompressedSha256 :string
-
A hex-encoded SHA-256 digest of the image contents when uncompressed.
Type:
- string
Methods
-
<static> compareById(l, r)
-
Compare two
SolarNodeImageInfo
objects based on their IDs.The
id
values are compared in a case-insensitive manner, using a natural number ordering.Parameters:
Name Type Description l
SolarNodeImageInfo the left-hand object to compare
r
SolarNodeImageInfo the right-hand object to compare
Returns:
<
0
ifl
sorts beforer
, >0
ifl
sorts afterr
, or0
ifl
andr
sort equally- Type
- number
-
<static> fromJsonEncoding(json)
-
Parse a JSON string into a
module:domain~SolarNodeImageInfo
instance.The JSON must be encoded the same way
module:domain~SolarNodeImageInfo#toJsonEncoding
does.Parameters:
Name Type Description json
string | Object the JSON to parse, or a parsed JSON object
Returns:
the session instance
-
<static> idComponentGroups(imageList)
-
Take an array of
SolarNodeImageInfo
objects and split them into a hierarchy based on the components of their IDs.The ID components are derived by splitting the
id
values on a-
(dash) character. They are then grouped going from left to right by component.Parameters:
Name Type Description imageList
Array.<SolarNodeImageInfo> the image infos to get a hierarchy for
Returns:
the hierarchy as a list of groups
- Type
- Array.<module:domain~SolarNodeImageGroup>
-
displayNameForComponent()
-
Get a display name based on the most specific component of this image's
id
value.The components of the
id
are based on splitting it on a-
character. This method returns the right-most component. If that component has a date-like structure, the date will be formatted slightly.Returns:
the display name
- Type
- string
-
hasId(id)
-
Compare an ID value with this object's ID value.
This method performs a case-insensitive compare similar to
module:domain~SolarNodeImageInfo#compareById
.Parameters:
Name Type Description id
string an ID value to compare
Returns:
true
ifid
matches this object'sid
- Type
- boolean
-
toJsonEncoding()
-
Get this object as a standard JSON encoded string value.
Returns:
the JSON encoded string
- Type
- string