- package sample;
- import blanco.notnull.BlancoNotNull;
- import blanco.trace.BlancoTrace;
- /**
- * 非 NULL のサンプル。
- */
- public abstract class AbstractSampleNotNull {
- /**
- * パラメータあり、戻り値なし。
- *
- * @param abc
- * パラメータ 1.
- */
- public void a11(@BlancoNotNull final String abc) {
- }
- public String a21(@BlancoNotNull final String abc, @BlancoNotNull final String def) {
- return "あああ:" + abc + ", " + def;
- }
- /**
- * トレースと非 NULL との組み合わせ。
- *
- * @param abc
- * @param def
- * @return
- */
- @BlancoTrace
- public String a91(@BlancoNotNull final String abc, @BlancoNotNull final String def) {
- return "あああ:" + abc + ", " + def;
- }
- }
- package sample;
- /**
- * 非 NULL のサンプル。
- */
- public class SampleNotNull extends AbstractSampleNotNull {
- /**
- * パラメータあり、戻り値なし。
- *
- * @param abc パラメータ 1.
- */
- public void a11(String abc) {
- if (abc == null) {
- throw new IllegalArgumentException("不正引数例外: SampleNotNull#a11(String abc) のパラメータ 'abc' に null を与えることはできません。");
- }
- super.a11(abc);
- }
- /**
- *
- * @param abc
- * @param def
- * @return
- */
- public String a21(String abc, String def) {
- java.lang.String autoValMethodResult;
- if (abc == null) {
- throw new IllegalArgumentException("不正引数例外: SampleNotNull#a21(String abc, String def) のパラメータ 'abc' に null を与えることはできません。");
- }
- if (def == null) {
- throw new IllegalArgumentException("不正引数例外: SampleNotNull#a21(String abc, String def) のパラメータ 'def' に null を与えることはできません。");
- }
- autoValMethodResult = super.a21(abc, def);
- return autoValMethodResult;
- }
- /**
- * トレースと非 NULL との組み合わせ。
- *
- * @param abc
- * @param def
- * @return
- */
- public String a91(String abc, String def) {
- java.lang.String autoValMethodResult;
- long autoValStartTimeMillisec = System.currentTimeMillis();
- System.out.println("trace: AbstractSampleNotNull#a91(" + abc + ", " + def + ") begin.");
- if (abc == null) {
- throw new IllegalArgumentException("不正引数例外: SampleNotNull#a91(String abc, String def) のパラメータ 'abc' に null を与えることはできません。");
- }
- if (def == null) {
- throw new IllegalArgumentException("不正引数例外: SampleNotNull#a91(String abc, String def) のパラメータ 'def' に null を与えることはできません。");
- }
- autoValMethodResult = super.a91(abc, def);
- System.out.println("trace: AbstractSampleNotNull#a91(" + abc + ", " + def + ") end. " + "[" + autoValMethodResult + "] " + (System.currentTimeMillis() - autoValStartTimeMillisec) + "ms");
- return autoValMethodResult;
- }
- }