Package com.g2forge.alexandria.java.text
Class TextUpdate<O>
- java.lang.Object
-
- com.g2forge.alexandria.java.text.TextUpdate<O>
-
public class TextUpdate<O> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TextUpdate.TextUpdateBuilder<O>
-
Field Summary
Fields Modifier and Type Field Description protected IFunction1<? super CharSequence,? extends O>
function
A function from the contents of the region defined bygetOffset()
andgetLength()
to the value to replace it with.protected int
length
The length of the input text region to replace.protected int
offset
The offset in the input text of the region to replace.
-
Constructor Summary
Constructors Constructor Description TextUpdate(int offset, int length, IFunction1<? super CharSequence,? extends O> function)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <O> TextUpdate.TextUpdateBuilder<O>
builder()
protected boolean
canEqual(Object other)
boolean
equals(Object o)
IFunction1<? super CharSequence,? extends O>
getFunction()
A function from the contents of the region defined bygetOffset()
andgetLength()
to the value to replace it with.int
getLength()
The length of the input text region to replace.int
getOffset()
The offset in the input text of the region to replace.int
hashCode()
TextUpdate.TextUpdateBuilder<O>
toBuilder()
String
toString()
-
-
-
Field Detail
-
offset
protected final int offset
The offset in the input text of the region to replace.
-
length
protected final int length
The length of the input text region to replace. May be0
to insert something.
-
function
protected final IFunction1<? super CharSequence,? extends O> function
A function from the contents of the region defined bygetOffset()
andgetLength()
to the value to replace it with. Depending on the consumer anull
or""
return value can be used to delete text.
-
-
Constructor Detail
-
TextUpdate
@ConstructorProperties({"offset","length","function"}) public TextUpdate(int offset, int length, IFunction1<? super CharSequence,? extends O> function)
-
-
Method Detail
-
builder
public static <O> TextUpdate.TextUpdateBuilder<O> builder()
-
toBuilder
public TextUpdate.TextUpdateBuilder<O> toBuilder()
-
getOffset
public int getOffset()
The offset in the input text of the region to replace.- Returns:
- The offset in the input text of the region to replace.
-
getLength
public int getLength()
The length of the input text region to replace. May be0
to insert something.- Returns:
- The length of the input text region to replace.
-
getFunction
public IFunction1<? super CharSequence,? extends O> getFunction()
A function from the contents of the region defined bygetOffset()
andgetLength()
to the value to replace it with. Depending on the consumer anull
or""
return value can be used to delete text.- Returns:
- A function from the contents of this region to the value to replace it with.
-
canEqual
protected boolean canEqual(Object other)
-
-