Getting data from the clipboard should look like this :
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0);
pasteData = item.getText();
You do have to check a few things about pasteData
to use it properly : is it text ? is it null ? ...
Setting a value in the clipboard should look like this :
ClipData clip = ClipData.newPlainText("simple text", "Hello, World!");
clipboard.setPrimaryClip(clip);
You don't have to change an existing value, just create a new one.
This is all just a rough explanation as I don't really know what your use case is but I recommend you check out this documentation for more details :
https://developer.android.com/guide/topics/text/copy-paste#java