Creates a Number for the {@code source} and {@code destinationType}.
762275
Number numberFor(Number source, Class<?> destinationType) {
    if (destinationType.equals(source.getClass()))
      return source;

    if (destinationType.equals(Byte.class)) {
      long longValue = source.longValue();
      if (longValue > Byte.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      if (longValue < Byte.MIN_VALUE)
        throw new Errors().errorTooSmall(source, destinationType).toMappingException();
      return Byte.valueOf(source.byteValue());
    }

    if (destinationType.equals(Short.class)) {
      long longValue = source.longValue();
      if (longValue > Short.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      if (longValue < Short.MIN_VALUE)
        throw new Errors().errorTooSmall(source, destinationType).toMappingException();
      return Short.valueOf(source.shortValue());
    }

    if (destinationType.equals(Integer.class)) {
      long longValue = source.longValue();
      if (longValue > Integer.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      if (longValue < Integer.MIN_VALUE)
        throw new Errors().errorTooSmall(source, destinationType).toMappingException();
      return Integer.valueOf(source.intValue());
    }

    if (destinationType.equals(Long.class))
      return Long.valueOf(source.longValue());

    if (destinationType.equals(Float.class)) {
      if (source.doubleValue() > Float.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      return Float.valueOf(source.floatValue());
    }

    if (destinationType.equals(Double.class))
      return Double.valueOf(source.doubleValue());

    if (destinationType.equals(BigDecimal.class)) {
      if (source instanceof Float || source instanceof Double)
        return new BigDecimal(source.toString());
      else if (source instanceof BigInteger)
        return new BigDecimal((BigInteger) source);
      else
        return BigDecimal.valueOf(source.longValue());
    }

    if (destinationType.equals(BigInteger.class)) {
      if (source instanceof BigDecimal)
        return ((BigDecimal) source).toBigInteger();
      else
        return BigInteger.valueOf(source.longValue());
    }

    throw new Errors().errorMapping(source, destinationType).toMappingException();
  }
4646
public static CopyJobConfiguration of(TableId destinationTable, List<TableId> sourceTables) {
    return newBuilder(destinationTable, sourceTables).build();
  }
1060668
protected final Direction getDirectionForType(final Class<S> sourceType, final Class<T> targetType, final Class<? extends NodeInterface> type) {

		// FIXME: this method will most likely not do what it's supposed to do..
		if (sourceType.equals(type) && targetType.equals(type)) {
			return Direction.BOTH;
		}

		if (sourceType.equals(type)) {
			return Direction.OUTGOING;
		}

		if (targetType.equals(type)) {
			return Direction.INCOMING;
		}

		/* one of these blocks is wrong...*/
		if (sourceType.isAssignableFrom(type) && targetType.isAssignableFrom(type)) {
			return Direction.BOTH;
		}

		if (sourceType.isAssignableFrom(type)) {
			return Direction.OUTGOING;
		}

		if (targetType.isAssignableFrom(type)) {
			return Direction.INCOMING;
		}

		/* one of these blocks is wrong...*/
		if (type.isAssignableFrom(sourceType) && type.isAssignableFrom(targetType)) {
			return Direction.BOTH;
		}

		if (type.isAssignableFrom(sourceType)) {
			return Direction.OUTGOING;
		}

		if (type.isAssignableFrom(targetType)) {
			return Direction.INCOMING;
		}

		return Direction.BOTH;
	}
359865
private static void addTernaryValues(IntegerVector destination,
                                         TernaryVector source) {
        for (int p : source.positiveDimensions())
            destination.add(p, 1);
        for (int n : source.negativeDimensions())
            destination.add(n, -1);
    }
141677
public static Identifier create(String identifier, SourceLocation location) {
    checkArgument(!identifier.isEmpty());
    return new AutoValue_Identifier(identifier, location);
  }
548752
public static <S, D> List<D> mapList(Iterable<S> sourceList, Class<D> destinationClass) {
		List<D> destinationList = new ArrayList<D>();
		for (S source : sourceList) {
			if (source != null) {
				destinationList.add(mapper.map(source, destinationClass));
			}
		}
		return destinationList;
	}
898510
private void createDestination(String name, 
                                 com.ibm.wsspi.sib.core.DestinationType destType,
                                 Reliability defaultReliability)
    throws JMSException
  {
    if (tcInt.isEntryEnabled())
      SibTr.entry(tcInt, "createDestination(String, DestinationType)");
      
    if (tcInt.isDebugEnabled())
    {
      SibTr.debug(tcInt, "name: "+name);
      SibTr.debug(tcInt, "type: "+destType);
    }
    
    try
    {

      try
      {
        
        // Obtain information about the destination from the core connection.
        SIDestinationAddress sida = JmsServiceFacade.getSIDestinationAddressFactory().createSIDestinationAddress(name, null);        
        DestinationConfiguration dc = coreConnection.getDestinationConfiguration(sida);
        
        // If the Destination exists, then recreate it.        
        if (dc != null)
        {
          String uuid = dc.getUUID();  
          if (tcInt.isDebugEnabled()) SibTr.debug(tcInt, "delete UUID: "+uuid);
          
          // The destination has been found, so delete it.
          admin.deleteDestinationLocalization(uuid, null);
             
        } else
        {
          if (tcInt.isDebugEnabled())
            SibTr.debug(tcInt, "No object was returned from getDestinationConfiguration");
        }
        
        
      } catch(SINotPossibleInCurrentConfigurationException f)
      {
        // No FFDC code needed
        // This is OK. No action required.
      }      
      
      //lohith liberty change
      
      com.ibm.ws.sib.admin.DestinationDefinition adminDDF = null ; //JsAdminFactory.getInstance(.createDestinationDefinition(destType, name);          
      adminDDF.setMaxReliability(Reliability.ASSURED_PERSISTENT);
      adminDDF.setDefaultReliability(defaultReliability);

      // Set the default exception destination
      String excDestinationName = SIMPConstants.SYSTEM_DEFAULT_EXCEPTION_DESTINATION+getMEName();
      adminDDF.setExceptionDestination(excDestinationName);

      //lohith liberty change
      LocalizationDefinition dloc = null; // JsAdminFactory.getInstance().createLocalizationDefinition(name);
      
      // Make sure the max message count is outside the range used by the tests.
      dloc.setDestinationHighMsgs(30000);

      //lohith liberty change
      admin.createDestinationLocalization(adminDDF, dloc ); //, null, null, null, null);
      
      
    } catch (Exception se)
    {
      // No FFDC code needed
      if (tcInt.isDebugEnabled())
        SibTr.debug(tcInt, "Exception creating", se);
        
      // NB. No need to NLS this because it is only for unit test.
      JMSException jmse =
        new JMSException("Exception received creating destination");
      jmse.setLinkedException(se);
      jmse.initCause(se);
      
      if (tcInt.isEntryEnabled())
         SibTr.exit(tcInt, "createDestination(String, DestinationDefinition)");
      throw jmse;
    }
    
    if (tcInt.isEntryEnabled())
       SibTr.exit(tcInt, "createDestination(String, DestinationDefinition)");

  }
1346224
static Entry makeEntry(byte[] source, byte[] destination) {
        CaseInsensitiveBytesHash<Entry> sHash = transcoders.get(source);
        if (sHash == null) {
            sHash = new CaseInsensitiveBytesHash<Entry>();
            transcoders.putDirect(source, sHash);
        }
        Entry entry = sHash.get(destination);
        if (entry == null) {
            entry = new Entry(source, destination);
            sHash.putDirect(destination, entry);
        } else {
            throw new TranscoderException(ErrorMessages.ERR_TRANSCODER_ALREADY_REGISTERED, new String(source + " to " + new String(destination)));
        }

        return entry;
    }
535288
public void addCustomerSource(
            @NonNull String sourceId,
            @NonNull @Source.SourceType String sourceType,
            @Nullable SourceRetrievalListener listener) {
        final Map<String, Object> arguments = new HashMap<>();
        arguments.put(KEY_SOURCE, sourceId);
        arguments.put(KEY_SOURCE_TYPE, sourceType);

        final String operationId = UUID.randomUUID().toString();
        if (listener != null) {
            mSourceRetrievalListeners.put(operationId, listener);
        }
        mEphemeralKeyManager.retrieveEphemeralKey(operationId, ACTION_ADD_SOURCE, arguments);
    }
373659
public static <S, T> Convert<S, T> to(Typed<T> targetType, Position.Readable<S> sourcePosition) {
        return new Convert<>(sourcePosition, targetType.getType());
    }
109316
@NonNull
    public SourceParams setType(@Source.SourceType String type) {
        mType = type;
        mTypeRaw = type;
        return this;
    }
265402
public void add(final String source, final T destination) {

    // replace multiple slashes with a single slash.
    String path = source.replaceAll("/+", "/");

    path = (path.endsWith("/") && path.length() > 1)
      ? path.substring(0, path.length() - 1) : path;


    String[] parts = path.split("/", maxPathParts + 2);
    if (parts.length - 1 > maxPathParts) {
      throw new IllegalArgumentException(String.format("Number of parts of path %s exceeds allowed limit %s",
                                                       source, maxPathParts));
    }
    StringBuilder sb =  new StringBuilder();
    List<String> groupNames = new ArrayList<>();

    for (String part : parts) {
      Matcher groupMatcher = GROUP_PATTERN.matcher(part);
      if (groupMatcher.matches()) {
        groupNames.add(groupMatcher.group(1));
        sb.append("([^/]+?)");
      } else if (WILD_CARD_PATTERN.matcher(part).matches()) {
        sb.append(".*?");
      } else {
        sb.append(part);
      }
      sb.append("/");
    }

    //Ignore the last "/"
    sb.setLength(sb.length() - 1);

    Pattern pattern = Pattern.compile(sb.toString());
    patternRouteList.add(ImmutablePair.of(pattern, new RouteDestinationWithGroups(destination, groupNames)));
  }
1208051
@Override
    public DestinationAliasDefinition createDestinationAliasDefinition(DestinationType type, String name) {
        return new DestinationAliasDefinitionImpl(type, name);
    }
570656
public static Builder newBuilder(TableId destinationTable, List<TableId> sourceTables) {
    return new Builder().setDestinationTable(destinationTable).setSourceTables(sourceTables);
  }
634064
@Override
  public <CS, CD> MappingContext<CS, CD> create(CS source, Class<CD> destinationType) {
    Assert.notNull(source, "source");
    Assert.notNull(destinationType, "destinationType");

    return new MappingContextImpl<CS, CD>(this, source, Types.<CS>deProxy(source.getClass()), null,
        destinationType, null, null, false);
  }
1050648
public AsyncMessage createMessageForDestination(String destination) {
        AsyncMessage message = this.defaultMessageCreator.createMessage();
        message.setDestination(destination);
        return message;
    }
1087917
static void declare(String source, String destination, String transcoderClass) {
        Entry entry = makeEntry(source.getBytes(), destination.getBytes());
        entry.transcoderClass = transcoderClass;
    }