Package org.eolang.maven.name
Class DelimitedName
- java.lang.Object
-
- org.eolang.maven.name.DelimitedName
-
public final class DelimitedName extends Object
A class which encapsulates delimiter. It parses a raw string into two parts: title and optional label, dividing by means of the delimiter. It also does a reverse operation, concatenation of two strings with the delimiter (methodtoString()
).E.g. it divides a raw (concat) string as: - "org.eolang.text|0.1.0" into "org.eolang.text" and "0.1.0" - "org.eolang.text" into "org.eolang.text" and empty
Optional
It joins: - title "org.eolang.text" and label "0.1.0" into "org.eolang.text|0.1.0" - title "org.eolang.text" and an empty
Optional
label into "org.eolang.text"- Since:
- 0.33
-
-
Constructor Summary
Constructors Constructor Description DelimitedName(String concat)
Ctor.DelimitedName(String title, String label)
Ctor.DelimitedName(String title, Optional<String> label)
Ctor.DelimitedName(org.cactoos.Scalar<String> concat)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
label()
The optional label.String
title()
The title.String
toString()
-
-
-
Constructor Detail
-
DelimitedName
public DelimitedName(String concat)
Ctor.- Parameters:
concat
- Raw string.
-
DelimitedName
public DelimitedName(org.cactoos.Scalar<String> concat)
Ctor.- Parameters:
concat
- Raw string as scalar.
-
DelimitedName
public DelimitedName(String title, String label)
Ctor.- Parameters:
title
- The title.label
- The optional label
-
-