Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider 6f333f78 rédigé par Reda ESSEKKAKI's avatar Reda ESSEKKAKI
Parcourir les fichiers

adding missing Asciidoc comments on methods

parent 95ffc973
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!3Added mising documentation on methods & use of the licence plugin for maven
......@@ -19,6 +19,11 @@ public class StringAssertion extends ComparableAssertion<StringAssertion, String
value = actual;
}
/**
* Returns a new StringAssertion object for the specified actual value.
*
* @param actual the actual value being compared
*/
public static StringAssertion stringAssertThat(String actual) {
new StringAssertion(actual);
return (StringAssertion) assertion();
......@@ -234,7 +239,7 @@ public class StringAssertion extends ComparableAssertion<StringAssertion, String
}
/**
* Assert that actual is not of length length
* Assert that actual is not of length equal to the parameter "length"
*
* @param length the length actual should not be
*/
......@@ -243,8 +248,6 @@ public class StringAssertion extends ComparableAssertion<StringAssertion, String
check = false;
message += String.format("\nExpecting string (%s) of length %s to not have length %s", value, value.length(), length);
}
return this;
}
}
......@@ -14,6 +14,11 @@ public class UnidirectionalAssertion<YOURSELF extends ObjectAssertion<YOURSELF,
super(actual);
}
/**
* Returns a new UnidirectionalAssertion object for the specified actual value.
*
* @param actual the actual wrapper being compared
*/
static UnidirectionalAssertion<?, UnidirectionalWrapper> assertThatAssociation(UnidirectionalWrapper<?> actual) {
new UnidirectionalAssertion<>(actual);
return (UnidirectionalAssertion) assertion();
......
......@@ -7,23 +7,46 @@
*/
package org.atlanmod.commons.assertions;
/**
* A simple wrapper class that allows you to store a value of type E and check if the value is set or not.
*/
public class UnidirectionalWrapper<E> {
/**
* The value stored in the wrapper.
*/
private E value = null;
/**
* Returns the value stored in the wrapper.
*
* @return the value stored in the wrapper
*/
public E get() {
return value;
}
/**
* Sets the value stored in the wrapper to a new value.
*
* @param newVal the new value to store in the wrapper
*/
public void set(E newVal) {
value = newVal;
}
/**
* Unsets the value stored in the wrapper by setting it to null.
*/
public void unset() {
value = null;
}
/**
* Checks if the value stored in the wrapper is set or not.
*
* @return true if the value is set, false otherwise
*/
public boolean isSet() {
return value != null;
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter