net.bramp.ffmpeg.modelmapper.NotDefaultCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ffmpeg Show documentation
Show all versions of ffmpeg Show documentation
Simple Java wrapper around FFmpeg command-line interface
package net.bramp.ffmpeg.modelmapper;
import com.google.common.base.Defaults;
import com.google.common.base.Objects;
import org.modelmapper.Condition;
import org.modelmapper.spi.MappingContext;
/**
* Only maps properties which are not their type's default value.
*
* @param source type
* @param destination type
*
* @author bramp
*/
public class NotDefaultCondition implements Condition {
public final static NotDefaultCondition notDefault = new NotDefaultCondition();
@Override
public boolean applies(MappingContext context) {
return !Objects.equal(context.getSource(), Defaults.defaultValue(context.getSourceType()));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy