Skip to content

Commit bc04881

Browse files
authored
Merge pull request #40 from RUB-NDS/Modifiable.String
added modifiable quick interface
2 parents 02cc135 + 7d144ea commit bc04881

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/de/rub/nds/modifiablevariable/util/Modifiable.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import de.rub.nds.modifiablevariable.mlong.ModifiableLong;
1515
import de.rub.nds.modifiablevariable.singlebyte.ByteModificationFactory;
1616
import de.rub.nds.modifiablevariable.singlebyte.ModifiableByte;
17+
import de.rub.nds.modifiablevariable.string.ModifiableString;
18+
import de.rub.nds.modifiablevariable.string.StringModificationFactory;
1719

1820
import java.math.BigInteger;
1921

@@ -57,6 +59,12 @@ private static ModifiableBoolean getModifiableBooleanWithModification(VariableMo
5759
return modifiableBoolean;
5860
}
5961

62+
private static ModifiableString getModifiableStringWithModification(VariableModification<String> modification) {
63+
ModifiableString modifiableString = new ModifiableString();
64+
modifiableString.setModification(modification);
65+
return modifiableString;
66+
}
67+
6068
public static ModifiableByteArray explicit(byte[] b) {
6169
return getModifiableByteArrayWithModification(ByteArrayModificationFactory.explicitValue(b));
6270
}
@@ -169,4 +177,8 @@ public static ModifiableInteger shiftRight(Integer i) {
169177
return getModifiableIntegerWithModification(IntegerModificationFactory.shiftRight(i));
170178
}
171179

180+
public static ModifiableString explicit(String s) {
181+
return getModifiableStringWithModification(StringModificationFactory.explicitValue(s));
182+
}
183+
172184
}

0 commit comments

Comments
 (0)