@Override public Object marshall(final Object transferObject, final Map<String, String> context) { if (transferObject == null) { return null; } return assertInstance(transferObject, byte[].class, "bytes array expected [actual={}]", transferObject.getClass().getSimpleName()); }
/** * Looks up a destination via JNDI. */ protected Destination lookupJmsDestination(final IDestination<?> destination) throws NamingException { final Object object = Assertions.assertNotNull(createContext().lookup(destination.getName())); final Class<?> expectedType = (destination.getType() == DestinationType.QUEUE ? Queue.class : Topic.class); Assertions.assertInstance(object, expectedType, "The looked up destination is of type '{}', but expected type '{}' [{}]", object.getClass().getName(), expectedType.getName(), destination); return (Destination) object; }
protected void handleModelColumnBackgroundEffectChanged(TableEvent event) { JSONObject jsonEvent = new JSONObject(); JSONArray eventParts = new JSONArray(); for (IColumn<?> c : event.getColumns()) { Assertions.assertInstance(c, INumberColumn.class, "ColumnBackgroundEffect is only supported on NumberColumns"); JSONObject eventPart = new JSONObject(); putProperty(eventPart, "columnId", getColumnId(c)); putProperty(eventPart, "backgroundEffect", ((INumberColumn) c).getBackgroundEffect()); eventParts.put(eventPart); } putProperty(jsonEvent, "eventParts", eventParts); addActionEvent(EVENT_COLUMN_BACKGROUND_EFFECT_CHANGED, jsonEvent); }
protected void handleModelColumnAggregationChanged(TableEvent event) { JSONObject jsonEvent = new JSONObject(); JSONArray eventParts = new JSONArray(); for (IColumn<?> c : event.getColumns()) { Assertions.assertInstance(c, INumberColumn.class, "ColumnAggregation is only supported on NumberColumns"); JSONObject eventPart = new JSONObject(); putProperty(eventPart, "columnId", getColumnId(c)); putProperty(eventPart, "aggregationFunction", ((INumberColumn) c).getAggregationFunction()); eventParts.put(eventPart); } putProperty(jsonEvent, "eventParts", eventParts); addActionEvent(EVENT_COLUMN_AGGR_FUNC_CHANGED, jsonEvent); }
private void fireColumnBackgroundEffectChanged(IColumn<?> c) { Assertions.assertInstance(c, INumberColumn.class, "BackgroundEffect is only supported on NumberColumns."); TableEvent e = new TableEvent(m_table, TableEvent.TYPE_COLUMN_BACKGROUND_EFFECT_CHANGED); e.setColumns(CollectionUtility.arrayList(c)); m_table.fireTableEventInternal(e); }
private void fireColumnAggregationChanged(IColumn<?> c) { Assertions.assertInstance(c, INumberColumn.class, "ColumnAggregation is only supported on NumberColumns."); TableEvent e = new TableEvent(m_table, TableEvent.TYPE_COLUMN_AGGREGATION_CHANGED); e.setColumns(CollectionUtility.arrayList(c)); m_table.fireTableEventInternal(e); }
protected void handleColumnAggregationFunctionChanged(JsonEvent event) { addTableEventFilterCondition(TableEvent.TYPE_COLUMN_AGGREGATION_CHANGED); IColumn column = extractColumn(event.getData()); Assertions.assertInstance(column, INumberColumn.class, "Aggregation can only be specified on numeric columns"); getModel().getUIFacade().fireAggregationFunctionChanged((INumberColumn<?>) column, event.getData().getString("aggregationFunction")); }
protected void handleColumnBackgroundEffectChanged(JsonEvent event) { addTableEventFilterCondition(TableEvent.TYPE_COLUMN_BACKGROUND_EFFECT_CHANGED); IColumn column = extractColumn(event.getData()); Assertions.assertInstance(column, INumberColumn.class, "BackgroundEffect can only be specified on numeric columns"); getModel().getUIFacade().setColumnBackgroundEffect((INumberColumn<?>) column, event.getData().optString("backgroundEffect", null)); }
@Override protected BenchColumnData copyValues(FlexboxLayoutData copyRaw) { Assertions.assertInstance(copyRaw, BenchColumnData.class); super.copyValues(copyRaw); BenchColumnData copy = (BenchColumnData) copyRaw; if (getSouth() != null) { copy.withSouth(getSouth().copy()); } if (getCenter() != null) { copy.withCenter(getCenter().copy()); } if (getNorth() != null) { copy.withNorth(getNorth().copy()); } return copy; }