本文整理汇总了Java中net.meisen.general.genmisc.types.Objects类的典型用法代码示例。如果您正苦于以下问题:Java Objects类的具体用法?Java Objects怎么用?Java Objects使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Objects类属于net.meisen.general.genmisc.types包,在下文中一共展示了Objects类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
} else if (obj == null) {
return false;
} else if (obj instanceof DescriptorHierarchy) {
final DescriptorHierarchy dh = (DescriptorHierarchy) obj;
return Objects.equals(getId(), dh.getId())
&& Objects.equals(descriptorDimension,
dh.descriptorDimension);
} else {
return false;
}
}
示例2: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
} else if (obj instanceof BitmapId) {
final BitmapId<?> bId = (BitmapId<?>) obj;
return bId.hashCode() == hashCode()
&& Objects.equals(bId.getId(), getId())
&& Objects.equals(bId.getType(), getType())
&& Objects.equals(bId.getClassifier(), getClassifier());
} else {
return false;
}
}
示例3: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object o) {
boolean cmp = false;
if (o == this) {
cmp = true;
} else if (o == null) {
// nothing to do
} else if (getClass().equals(o.getClass())) {
@SuppressWarnings("unchecked")
final Descriptor<D, ?, ?> d = (Descriptor<D, ?, ?>) o;
if (Objects.equals(getValue(), d.getValue())
&& Objects.equals(getModel(), d.getModel())) {
cmp = true;
}
}
return cmp;
}
示例4: addDescriptor
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
/**
* Adds the descriptor with the specified {@code id} and {@code value} to
* {@code this}. If a descriptor with the same values is already added the
* descriptor of {@code this} is returned, otherwise one is created.
*
* @param id
* the identifier of the descriptor to be added
* @param value
* the value of the descriptor
*
* @return the added descriptor or the an equal descriptor already added to
* the model
*/
public <D> Descriptor<D, ?, I> addDescriptor(final I id, final D value) {
Descriptor descriptor;
if (value == null) {
if (!createdNullDescriptor()) {
nullDescriptor = new NullDescriptor<I>(this, id);
} else if (!Objects.equals(nullDescriptor.getId(), id)) {
exceptionRegistry.throwException(
DescriptorModelException.class, 1008, id, null,
nullDescriptor);
}
descriptor = getNullDescriptor();
} else if ((descriptor = getDescriptor(id)) == null) {
descriptor = createDescriptor(id, value);
} else if (!Objects.equals(descriptor.getValue(), value)) {
exceptionRegistry.throwException(DescriptorModelException.class,
1008, id, value, descriptor);
}
@SuppressWarnings("unchecked")
final Descriptor<D, ?, I> typedDescriptor = (Descriptor<D, ?, I>) descriptor;
return typedDescriptor;
}
示例5: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object o) {
boolean cmp = false;
if (o == this) {
cmp = true;
} else if (o == null) {
// nothing to do
} else if (getClass().equals(o.getClass())) {
@SuppressWarnings("unchecked")
final T d = (T) o;
// check the values
if (valueEquals(d) && Objects.equals(getModel(), d.getModel())) {
cmp = true;
}
}
return cmp;
}
示例6: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object o) {
if (o == null) {
return false;
} else if (o == this) {
return true;
} else if (o instanceof TimelineDefinition) {
final TimelineDefinition cmp = (TimelineDefinition) o;
return Objects.equals(cmp.type, type)
&& Objects.equals(cmp.granularity, granularity)
&& Objects.equals(cmp.start, start)
&& Objects.equals(cmp.end, end);
} else {
return false;
}
}
示例7: removePrefix
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
/**
* Creates a sub-group of {@code this} by removing the {@code prefix}.
*
* @param prefix
* the prefix to be removed
*
* @return the sub-group, or {@code null} if the prefix is not an actual
* prefix
*/
public Group removePrefix(final Group prefix) {
// if the prefix is longer it cannot be a prefix for sure
if (prefix.size() > size() || isEmpty()) {
return null;
}
// validate
for (int i = 0; i < prefix.size(); i++) {
final String prefixValue = prefix.getPart(i);
if (!Objects.equals(prefixValue, getPart(i))) {
return null;
}
}
return new Group(Arrays.copyOfRange(items, prefix.size(), size()));
}
示例8: getMember
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
/**
* Gets the member defined within the {@code SelectorMemberContext}.
*
* @param selMember
* the context to read the member from
*
* @return the {@code DimensionSelector} defined by the context
*/
protected DimensionSelector getMember(final SelectorMemberContext selMember) {
final int childrenSize = selMember.getChildCount();
if (childrenSize != 5) {
throw new ForwardedRuntimeException(QueryParsingException.class,
1022, selMember.getText());
}
final String dimId = selMember.getChild(TerminalNode.class, 0)
.getText();
final String hierarchyId = selMember.getChild(TerminalNode.class, 2)
.getText();
final String levelId = selMember.getChild(TerminalNode.class, 4)
.getText();
// make sure none is empty
if (Objects.empty(dimId) || Objects.empty(hierarchyId)
|| Objects.empty(levelId)) {
throw new ForwardedRuntimeException(QueryParsingException.class,
1022, selMember.getText());
}
return new DimensionSelector(dimId, hierarchyId, levelId);
}
示例9: assertDescriptors
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
/**
* Helper method to validate the values of a descriptor.
*
* @param descriptors the descriptors found
* @param values the descriptors expected (values)
*/
protected void assertDescriptors(final Collection<?> descriptors,
final Object... values) {
assertEquals(descriptors.size(), values.length);
for (final Object o : descriptors) {
assertTrue(o instanceof Descriptor);
final Descriptor<?, ?, ?> descriptor = (Descriptor<?, ?, ?>) o;
final Object descValue = descriptor.getValue();
boolean found = false;
for (final Object value : values) {
if (Objects.equals(descValue, value)) {
if (value != null) {
assertEquals(descValue.getClass(), value.getClass());
}
found = true;
break;
}
}
assertTrue(descValue + " not found.", found);
}
}
示例10: setXsltTransformer
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
/**
* This method is used to set the transformer to be used for the
* transformation. It reads the transformer from the passed
* <code>xsltClassPath</code>.
*
* @param xsltClassPath
* the <code>String</code> pointing to the XSLT on the classpath
*
* @throws InvalidXsltException
* if the XSLT cannot be found on the classpath, the XSLT is
* invalid, ...
*/
public void setXsltTransformer(final String xsltClassPath)
throws InvalidXsltException {
if (Objects.empty(xsltClassPath)) {
setXsltTransformer((InputStream) null);
} else {
try {
setXsltTransformer(new ClassPathResource(xsltClassPath)
.getInputStream());
} catch (final IOException e) {
throw new InvalidXsltException(
"The xslt could not be read from the classpath '"
+ xsltClassPath + "'", e);
}
}
}
示例11: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object obj) {
boolean equal = true;
if (obj instanceof RasterModelGroupKey) {
final RasterModelGroupKey rmgk = (RasterModelGroupKey) obj;
final List<Object> key = rmgk.key;
if (key.size() != this.key.size()) {
equal = false;
} else {
// compare the lists
for (int i = 0; i < key.size(); i++) {
if (!Objects.equals(key.get(i), this.key.get(i))) {
equal = false;
break;
}
}
}
} else {
equal = false;
}
return equal;
}
示例12: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
} else if (obj == null) {
return false;
} else if (obj instanceof DescriptorDimension) {
final DescriptorDimension cmpDim = (DescriptorDimension) obj;
return Objects.equals(getDescriptorModelId(),
cmpDim.getDescriptorModelId())
&& Objects.equals(getId(), cmpDim.getId());
} else {
return false;
}
}
示例13: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
} else if (obj == null) {
return false;
} else if (obj instanceof DescriptorMember) {
final DescriptorMember cmpMember = (DescriptorMember) obj;
return Objects.equals(id, cmpMember.getId())
&& Objects.equals(getHierachy(), cmpMember.getHierachy());
} else {
return false;
}
}
示例14: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
} else if (obj == null) {
return false;
} else if (obj instanceof DescriptorLevel) {
final DescriptorLevel cmpLevel = (DescriptorLevel) obj;
return Objects.equals(id, cmpLevel.getId())
&& Objects.equals(getHierachy(), cmpLevel.getHierachy());
} else {
return false;
}
}
示例15: equals
import net.meisen.general.genmisc.types.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
} else if (obj == null) {
return false;
} else if (obj instanceof TimeLevelMember) {
final TimeLevelMember tmr = (TimeLevelMember) obj;
return Objects.equals(tmr.getId(), getId())
&& Objects.equals(tmr.getRanges(), getRanges());
} else {
return false;
}
}