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

net.bramp.ffmpeg.modelmapper.NotDefaultCondition Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
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