All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nd4j.imports.descriptors.properties.adapters.StringEqualsAdapter Maven / Gradle / Ivy

There is a newer version: 1.0.0-M2.1
Show newest version
package org.nd4j.imports.descriptors.properties.adapters;

import lombok.AllArgsConstructor;
import org.nd4j.autodiff.functions.DifferentialFunction;
import org.nd4j.imports.descriptors.properties.AttributeAdapter;

import java.lang.reflect.Field;

/**
 * Comparison for whether a string equals a target string
 * returning a boolean
 */
@AllArgsConstructor
public class StringEqualsAdapter implements AttributeAdapter {
    private String compString;

    @Override
    public void mapAttributeFor(Object inputAttributeValue, Field fieldFor, DifferentialFunction on) {
        on.setValueFor(fieldFor,inputAttributeValue.toString().equals(compString));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy