Example usage for java.lang Object equals

List of usage examples for java.lang Object equals

Introduction

In this page you can find the example usage for java.lang Object equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:jp.sourceforge.tmdmaker.ui.views.properties.DiagramPropertySource.java

@Override
public Object getPropertyValue(Object id) {
    if (id.equals(NAME)) {
        return diagram.getName() != null ? diagram.getName() : "";
    } else if (id.equals(DATABASE_NAME)) {
        return ArrayUtils.indexOf(dataBaseList, diagram.getDatabaseName());
    } else if (id.equals(DESCRIPTION)) {
        return diagram.getDescription() != null ? diagram.getDescription() : "";
    }/*from w ww .j  a  va 2  s.  c  om*/
    return null;
}

From source file:com.consol.citrus.samples.bookstore.endpoint.interceptor.BookAbstractAttachmentEndpointInterceptor.java

@Override
public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception {
    SoapMessage response = (SoapMessage) messageContext.getResponse();

    if (endpoint.equals(bookAbstractInboundGateway)) {
        response.addAttachment("book-abstract", new InputStreamSource() {
            public InputStream getInputStream() throws IOException {
                return bookAbstractResource.getInputStream();
            }/*from  www  .  j  a v a2 s.c om*/
        }, "text/plain");
    }

    return true;
}

From source file:it.unibas.spicygui.controllo.file.ActionSaveAsMappingTask.java

public void update(Observable o, Object stato) {
    if (stato.equals(LastActionBean.CLOSE) || (stato.equals(LastActionBean.NO_SCENARIO_SELECTED))
            || (stato.equals(LastActionBean.TGD_SESSION))) {
        this.setEnabled(false);
    } else {/*from  www.  ja  v  a2  s.c  o m*/
        this.setEnabled(true);
    }
}

From source file:it.unibas.spicygui.controllo.spicy.ActionRankTransformations.java

@Override
public void update(Observable o, Object stato) {
    if (stato.equals(LastActionBean.SOLVE) || stato.equals(LastActionBean.SOLVE_AND_TRANSLATE)) {
        this.setEnabled(true);
    } else if (stato.equals(LastActionBean.CLOSE)) {
        this.setEnabled(false);
    }//  w  w  w. ja  va 2s . c om
}

From source file:fr.openwide.core.wicket.more.model.BindingModel.java

private BindingModel(Object root, String propertyExpression) {
    super(root);/*from  ww  w . j  a v a2 s . co m*/
    if (ROOT.equals(propertyExpression)) {
        this.propertyExpression = null;
    } else {
        this.propertyExpression = propertyExpression;
    }
}

From source file:com.itemanalysis.psychometrics.cmh.CmhTableRow.java

public void count(Object rowValue, Double itemScore) {
    if (rowValue != null && rowValue.equals(this.rowValue)) {
        columns.addValue(itemScore);/*  w  w w.  j  a v  a  2 s  . co  m*/
        mean.increment(itemScore);
        rowTotal++;
    }
}

From source file:io.onedecision.engine.decisions.web.DecisionController.java

private String toJson(Map<String, Object> results) throws IOException {
    StringBuffer sb = new StringBuffer("{");
    for (Entry<String, Object> entry : results.entrySet()) {
        sb.append("\"").append(entry.getKey()).append("\":");
        Object val = entry.getValue();
        if (val instanceof String && val.equals("{}")) {
            sb.append(val);
        } else {//from  w  w w .j  a va2 s.c  om
            val = objectMapper.writeValueAsString(val);
            if (val instanceof String && ((String) val).startsWith("\"{")) {
                val = ((String) val).substring(1, ((String) val).length() - 1);
            }
            sb.append(((String) val).replaceAll("\\\\", ""));
        }
        sb.append(",");
    }
    if (sb.lastIndexOf(",") != -1) {
        sb.deleteCharAt(sb.lastIndexOf(",")).append("}");
    }
    return sb.toString();
}

From source file:com.github.stagirs.docextractor.wiki.WikiDocProcessor.java

@Override
public Document processDocument(String id, String str) {
    Document doc = new Document();
    doc.setId(id);//from   w w  w.  j  av  a2s  . c o  m
    List<Point> points = new ArrayList<Point>();
    doc.setPoints(points);
    points.add(new Point(0, true,
            str.substring(str.indexOf("<title>") + "<title>".length(), str.indexOf("</title>"))));
    if (!str.contains("<text xml:space=\"preserve\">")) {
        return doc;
    }
    String text = str.substring(
            str.indexOf("<text xml:space=\"preserve\">") + "<text xml:space=\"preserve\">".length(),
            str.indexOf("</text>"));
    text = text.replace("&lt;", "<").replace("&gt;",
            ">")/*.replaceAll("<!--.*?->", "").replaceAll("<.*?>.*?</*?>", "")*/;
    try {
        Iterator elems = WikiParser.getElems(LemmaParser.getLems(text).iterator(), null).iterator();
        List forPoint = new ArrayList();
        int level = 0;
        while (elems.hasNext()) {
            Object elem = elems.next();
            if (elem.equals("\t\t")) {
                if (!forPoint.isEmpty()) {
                    level = fillPoints(points, level, forPoint);
                    forPoint.clear();
                }
                continue;
            }
            forPoint.add(elem);
        }
        if (!forPoint.isEmpty()) {
            fillPoints(points, level, forPoint);
        }
        return doc;
    } catch (Exception ex) {
        throw new RuntimeException(ex);
    }
}

From source file:de.betterform.xml.xforms.ui.state.UIElementStateUtil.java

public static boolean hasValueChanged(Object currentValue, Object newValue) {
    if (currentValue instanceof Element && newValue instanceof Element) {
        DOMComparator comparator = new DOMComparator();
        comparator.setIgnoreNamespaceDeclarations(true);
        return !comparator.compare(((Element) currentValue), ((Element) newValue));
    } else if (newValue instanceof Element || currentValue instanceof Element) {
        return false;
    } else {/*w  w  w.  ja v a 2  s  . c  o m*/
        return (currentValue == null && newValue != null) || (currentValue != null && newValue == null)
                || (currentValue != null && !currentValue.equals(newValue));
    }
}

From source file:nz.net.orcon.kanban.automation.plugin.ScriptPluginTest.java

@Test
public void TestPlugin() throws Exception {
    final Action action = createAction();
    action.setResource("answer=x+y;");

    Map<String, Object> context = new HashMap<String, Object>();
    context.put("boardid", "test-board");
    context.put("x", 10);
    context.put("y", 15);

    Map<String, Object> process = getPlugin().process(action, context);
    Object result = process.get("answer");
    assertNotNull(result);//from  ww  w  .j a  va2s.c  om
    assertTrue(result.equals(new Double(25)));
}