Modifier | Constructor and Description |
---|---|
private |
Slug.Builder()
Use
factory method instead. |
Modifier and Type | Method and Description |
---|---|
Slug |
create()
Creates the
slugger . |
Slug.Builder |
custom(Map<String,String> custom)
Custom map for translation.
|
Slug.Builder |
lang(Language lang)
Language for symbol translation.
|
Slug.Builder |
maintainCase(boolean maintainCase)
How to deal with case of characters.
|
Slug.Builder |
mark(boolean mark)
Whether to allow additional characters.
|
static Slug.Builder |
newBuiler()
Creates new builder.
|
Slug.Builder |
separator(String separator)
Character that replace the whitespaces.
|
Slug.Builder |
titleCase(boolean titleCase)
Whether to convert input string to title-case.
|
Slug.Builder |
titleCaseExclude(Set<String> titleCaseExclude)
Words to exclude from title case.
|
Slug.Builder |
titleCaseExclude(String... titleCaseExclude)
Words to exclude from title case.
|
Slug.Builder |
truncate(int truncate)
Max length to truncate without breaking words.
|
Slug.Builder |
uric(boolean uric)
Whether to allow additional characters.
|
Slug.Builder |
uricNoSlash(boolean uricNoSlash)
Whether to allow additional characters.
|
private final Options options
private Slug.Builder()
factory method
instead.public static Slug.Builder newBuiler()
null
, always new instancepublic Slug.Builder separator(String separator)
separator
- must not be null
public Slug.Builder lang(Language lang)
Language.NONE
for don't convert symbols.
lang
- must not be null
public Slug.Builder maintainCase(boolean maintainCase)
maintainCase
- if true
maintain case, if false
convert all chars to lower casepublic Slug.Builder titleCase(boolean titleCase)
titleCase
- true
to convert, else false
public Slug.Builder titleCaseExclude(String... titleCaseExclude)
This option has only effect if titleCase
is set true
.
titleCaseExclude
- list of words to exclude, must not be null
public Slug.Builder titleCaseExclude(Set<String> titleCaseExclude)
This option has only effect if titleCase
is set true
.
titleCaseExclude
- list of words to exclude, must not be null
public Slug.Builder truncate(int truncate)
0
does not truncate.
truncate
- must not be negativepublic Slug.Builder uric(boolean uric)
If true
special characters will not be replaced.
uric
- if true
they will not be convertedpublic Slug.Builder uricNoSlash(boolean uricNoSlash)
If true
special characters will not be replaced.
uricNoSlash
- if true
they will not be convertedpublic Slug.Builder mark(boolean mark)
If true
special characters will not be replaced.
mark
- if true
they will not be convertedpublic Slug.Builder custom(Map<String,String> custom)
This overwrites all!
Example:
final Slug.Builder builder = Slug.Builder.newBuilder();
...
final Map<String, String> custom = new HashMap<>();
custom.put("&", "#");
custom.put("*", "star");
...
builder.custom(custom);
custom
- must not be null
Copyright © 2012 Sven Strittmatter. All Rights Reserved.