com.evolveum.prism.xml.ns._public.types_3.RawType.getValue()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(50)

本文整理了Java中com.evolveum.prism.xml.ns._public.types_3.RawType.getValue方法的一些代码示例,展示了RawType.getValue的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RawType.getValue方法的具体详情如下:
包路径:com.evolveum.prism.xml.ns._public.types_3.RawType
类名称:RawType
方法名:getValue

RawType.getValue介绍

暂无

代码示例

代码示例来源:origin: Evolveum/midpoint

/**
 * Extracts a "real value" from a potential RawType object without expecting any specific type beforehand.
 * (Useful e.g. for determining value of xsd:anyType XML property.)
 */
public static Object getValue(Object value) throws SchemaException {
  if (value instanceof RawType) {
    return ((RawType) value).getValue();
  } else {
    return value;
  }
}

代码示例来源:origin: Evolveum/midpoint

private void assertAttachmentContent(NotificationMessageAttachmentType attachment, Object expected) throws SchemaException {
  Object real = RawType.getValue(attachment.getContent());
  System.out.println("Expected: " + expected + " (" + expected.getClass() + ")");
  System.out.println("Real: " + real + " (" + real.getClass() + ")");
  if (expected instanceof byte[]) {
    System.out.println("Expected (unwrapped): " + toString(expected));
    System.out.println("Real (unwrapped): " + toString(real));
    assertEquals("Wrong value", toString(expected), toString(real));
  } else {
    assertEquals("Wrong value", expected, real);
  }
}

代码示例来源:origin: Evolveum/midpoint

if(attachment.getContent() != null) {
    try {
      Object content = RawType.getValue(attachment.getContent());
      if(content == null) {
        LOGGER.warn("RawType " + attachment.getContent() + " isn't possible to parse.");

代码示例来源:origin: Evolveum/midpoint

+ "m3pFJat9Ekl5H/2Q==";
byte[] origJPEG = Base64.getDecoder().decode(origJPEGString);
Object content = RawType.getValue(message.getAttachments().get(0).getContent());
if(!(content instanceof byte[]) || !Arrays.equals(origJPEG, (byte[])content)) {
  throw new AssertionError("Wrong content of attachments expected:" + origJPEG  + " but was:" + content);

代码示例来源:origin: Evolveum/midpoint

assertEquals("Wrong # of attachments", 1, message.getAttachments().size());
assertEquals("Wrong contentType of attachment", "text/plain", message.getAttachments().get(0).getContentType());
Object content = RawType.getValue(message.getAttachments().get(0).getContent());
assertEquals("Wrong content of attachments", "Hello world", content);
assertEquals("Wrong fileName of attachments", "plain.txt", message.getAttachments().get(0).getFileName());

相关文章