From 045f4d650441bd2a8231ccc45352177a0b22430b Mon Sep 17 00:00:00 2001 From: Ilia Kurtov Date: Fri, 3 Feb 2017 19:50:29 +0300 Subject: [PATCH] small comments --- .../validation/ConversionException.java | 34 ------------------- .../templates/validation/ValidationFunc.java | 10 +++--- .../validation/validators/Validator.java | 5 ++- 3 files changed, 9 insertions(+), 40 deletions(-) delete mode 100644 src/main/java/ru/touchin/templates/validation/ConversionException.java diff --git a/src/main/java/ru/touchin/templates/validation/ConversionException.java b/src/main/java/ru/touchin/templates/validation/ConversionException.java deleted file mode 100644 index 4392940..0000000 --- a/src/main/java/ru/touchin/templates/validation/ConversionException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2016 Touch Instinct - * - * This file is part of RoboSwag library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package ru.touchin.templates.validation; - -import android.support.annotation.Nullable; - -/** - * Created by Ilia Kurtov on 24/01/2017. - * TODO: fill - */ -public class ConversionException extends Exception { - - public ConversionException(@Nullable final Throwable cause) { - super(cause); - } - -} \ No newline at end of file diff --git a/src/main/java/ru/touchin/templates/validation/ValidationFunc.java b/src/main/java/ru/touchin/templates/validation/ValidationFunc.java index 8632db9..02a1e82 100644 --- a/src/main/java/ru/touchin/templates/validation/ValidationFunc.java +++ b/src/main/java/ru/touchin/templates/validation/ValidationFunc.java @@ -6,7 +6,7 @@ import java.io.Serializable; /** * Created by Ilia Kurtov on 30/01/2017. - * Simple interface that gets one parameter {@link TInput} as input and returns other type {@link TReturn}. + * Simple interface that gets one parameter with {@link TInput} type as input and returns other type {@link TReturn} as a result. * Interface extends {@link Serializable} to survive after {@link ru.touchin.roboswag.components.navigation.AbstractState} recreation. * Created as a replace for {@link rx.functions.Func1} because it needed to be {@link Serializable} * @param input type. @@ -15,10 +15,10 @@ import java.io.Serializable; public interface ValidationFunc extends Serializable { /** - * - * @param input - * @return - * @throws Throwable + * The method maps some {@link TInput} type argument into a {@link TReturn} type. + * @param input data; + * @return mapped data into a {@link TReturn} type. + * @throws Throwable for catching conversion errors. */ @NonNull TReturn call(@NonNull final TInput input) throws Throwable; diff --git a/src/main/java/ru/touchin/templates/validation/validators/Validator.java b/src/main/java/ru/touchin/templates/validation/validators/Validator.java index 9abcdac..9ab45f3 100644 --- a/src/main/java/ru/touchin/templates/validation/validators/Validator.java +++ b/src/main/java/ru/touchin/templates/validation/validators/Validator.java @@ -29,7 +29,10 @@ import ru.touchin.templates.validation.ValidationState; /** * Created by Ilia Kurtov on 24/01/2017. - * TODO: fill + * This class holds information about current state of the object - {@link #getWrapperModel()}(that should be connected to some view), + * current error state {@link #getValidationState()}. Also you need to provide a {@link ValidationState} or class that extends it + * as an empty state. Eg, if you need to show some text in your view to show user that this view shouldn't be empty - pass needed state + * to the {@link #getValidationStateWhenEmpty()} */ public abstract class Validator implements Serializable {